Added data download ability

This commit is contained in:
2023-02-19 21:10:00 +00:00
parent 48f080de7c
commit c850726f91
64 changed files with 12734 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
""" This module includes the functions used to hash and verify passwords
"""
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def verify_password(plain_password: str, hashed_password: str) -> bool:
"""verify_password
:param plain_password: password entered by user
:type plain_password: str
:param hashed_password: hashed password saved in database
:type hashed_password: str
:return: hashed_password and plain_password matched
:rtype: bool
"""
return pwd_context.verify(plain_password, hashed_password)
def get_password_hash(password: str) -> str:
"""get_password_hash get the hash of a password
:param password: the plain text password
:type password: str
:return: the hashed password from the plain text password
:rtype: str
"""
return pwd_context.hash(password)