mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-16 23:39:22 +01:00
utils.gen.saltHash: encode string before hashing it.
This commit is contained in:
parent
ab978a8c31
commit
d3d93da602
@ -148,7 +148,7 @@ def saltHash(password, salt=None, hash='sha'):
|
||||
hasher = crypt.sha
|
||||
elif hash == 'md5':
|
||||
hasher = crypt.md5
|
||||
return '|'.join([salt, hasher(salt + password).hexdigest()])
|
||||
return '|'.join([salt, hasher((salt + password).encode('utf8')).hexdigest()])
|
||||
|
||||
def safeEval(s, namespace={'True': True, 'False': False, 'None': None}):
|
||||
"""Evaluates s, safely. Useful for turning strings into tuples/lists/etc.
|
||||
|
Loading…
Reference in New Issue
Block a user