TG-35 : Typo

This commit is contained in:
Clément ARNAUDEAU
2017-01-23 15:50:20 +01:00
9 changed files with 105 additions and 5 deletions

View File

@ -5,11 +5,11 @@ from hashlib import sha512
SIMPLE_CHARS = string.ascii_letters + string.digits
def get_random_string(length=24):
def get_random_string(length=32):
return ''.join(random.choice(SIMPLE_CHARS) for i in range(length))
def get_random_hash(length=24):
def get_random_hash(length=64):
hash = sha512()
hash.update(get_random_string())
return hash.hexdigest()[:length]