Files
notifications-api/app/hashing.py
T

11 lines
340 B
Python
Raw Normal View History

2021-03-10 13:55:06 +00:00
from flask_bcrypt import check_password_hash, generate_password_hash
2020-01-23 17:36:32 +00:00
def hashpw(password):
2023-08-29 14:54:30 -07:00
return generate_password_hash(password.encode("UTF-8"), 10).decode("utf-8")
2020-01-23 17:36:32 +00:00
def check_hash(password, hashed_password):
# If salt is invalid throws a 500 should add try/catch here
return check_password_hash(hashed_password, password)