diff options
Diffstat (limited to 'api/passwords.py')
-rw-r--r-- | api/passwords.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/api/passwords.py b/api/passwords.py index 58b712d..011400e 100644 --- a/api/passwords.py +++ b/api/passwords.py @@ -3,11 +3,8 @@ import bcrypt def enc(string): return string.encode('utf-8') -def salt(): - return bcrypt.gensalt() +def check_password(password, password_hash): + return bcrypt.checkpw(enc(password), password_hash) -def check_password(password, salt, password_hash): - return bcrypt.checkpw(enc(password)+salt, enc(password_hash)) - -def password_hash(password, salt): - return bcrypt.hashpw(enc(password), salt); +def password_hash(password): + return bcrypt.hashpw(enc(password), bcrypt.gensalt()); |