Skip to content

Instantly share code, notes, and snippets.

@ocean1
Created May 19, 2014 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ocean1/fe9d8a428f3266663247 to your computer and use it in GitHub Desktop.
Save ocean1/fe9d8a428f3266663247 to your computer and use it in GitHub Desktop.
# took from here
# http://codahale.com/a-lesson-in-timing-attacks/
def is_equal(a, b):
if len(a) != len(b):
return False
result = 0
for x, y in zip(a, b):
result |= x ^ y
return result == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment