Skip to content

Commit

Permalink
Merge fa4a70f into a7073fe
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-eeo committed May 22, 2016
2 parents a7073fe + fa4a70f commit f7746b4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pyotp/utils.py
@@ -1,6 +1,10 @@
from __future__ import print_function, unicode_literals, division, absolute_import

import unicodedata
try:
from itertools import izip_longest
except ImportError:
from itertools import zip_longest as izip_longest

try:
from urllib.parse import quote
Expand Down Expand Up @@ -73,10 +77,9 @@ def strings_equal(s1, s2):
except ImportError:
pass

if len(s1) != len(s2):
return False

differences = 0
for c1, c2 in zip(s1, s2):
for c1, c2 in izip_longest(s1, s2):
if c1 is None or c2 is None:
pass
differences |= ord(c1) ^ ord(c2)
return differences == 0

0 comments on commit f7746b4

Please sign in to comment.