Update utils.py

This commit is contained in:
Pascal Vizeli 2018-02-18 12:31:06 +01:00 committed by GitHub
parent b8c50fee36
commit 0e2e588145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,9 +19,9 @@ def password_for_validating(password):
for _ in range(100):
password = hashlib.sha256(password.encode()).hexdigest()
try:
return int(str(sum(map(int, RE_DIGITS.findall(password))))[0])
return str(sum(map(int, RE_DIGITS.findall(password))))[0]
except (ValueError, IndexError):
return 0
return "0"
def key_to_iv(key):