3 ms·
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
by codedokode 10mo ago
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.