Loading django/utils/crypto.py +23 −19 Original line number Diff line number Diff line Loading @@ -77,6 +77,10 @@ def get_random_string(length=12, return ''.join(random.choice(allowed_chars) for i in range(length)) if hasattr(hmac, "compare_digest"): # Prefer the stdlib implementation, when available. constant_time_compare = hmac.compare_digest else: def constant_time_compare(val1, val2): """ Returns True if the two strings are equal, False otherwise. Loading Loading
django/utils/crypto.py +23 −19 Original line number Diff line number Diff line Loading @@ -77,6 +77,10 @@ def get_random_string(length=12, return ''.join(random.choice(allowed_chars) for i in range(length)) if hasattr(hmac, "compare_digest"): # Prefer the stdlib implementation, when available. constant_time_compare = hmac.compare_digest else: def constant_time_compare(val1, val2): """ Returns True if the two strings are equal, False otherwise. Loading