Logo
Explore Help
Sign In
darkhelm/notifications-api
1
0
Fork 0
You've already forked notifications-api
mirror of https://github.com/GSA/notifications-api.git synced 2026-02-19 01:23:04 -05:00
Code Issues Packages Projects Releases Wiki Activity
Files
python_3_13
notifications-api/app/hashing.py

11 lines
340 B
Python
Raw Permalink Normal View History

Run auto-correct on app/ and tests/
2021-03-10 13:55:06 +00:00
from flask_bcrypt import check_password_hash, generate_password_hash
Use encryption module from utils Now that the encryption module has been moved from this app to utils, we can remove it from here (along with its tests) and import it from utils instead. This also renames the `encryption.py` file to `hashing.py`, since it no longer contains the encryption class.
2020-01-23 17:36:32 +00:00
def hashpw(password):
reformat
2023-08-29 14:54:30 -07:00
return generate_password_hash(password.encode("UTF-8"), 10).decode("utf-8")
Use encryption module from utils Now that the encryption module has been moved from this app to utils, we can remove it from here (along with its tests) and import it from utils instead. This also renames the `encryption.py` file to `hashing.py`, since it no longer contains the encryption class.
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)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0 Page: 2035ms Template: 9ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API