Files
notifications-admin/app/main/encryption.py
T

11 lines
325 B
Python
Raw Normal View History

2015-11-30 15:33:40 +00:00
from flask.ext.bcrypt import generate_password_hash, check_password_hash
2015-11-30 15:33:40 +00:00
def hashpw(password):
return generate_password_hash(password.encode('UTF-8'), 10)
def checkpw(password, hashed_password):
2015-12-01 13:23:54 +00:00
# If salt is invalid throws a 500 should add try/catch here
2015-11-30 15:33:40 +00:00
return check_password_hash(hashed_password, password)