Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

By the way, for small arrays removing branches also improves performance (according to my tests). So if you do a constant-time comparison like this:

    match = True
    for a, b in pad(entered_pass, real_pass):
        match = match and a == b
    return match
Then it will be faster as well. I was surprised to find this.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: