taxpilot / auth /utils.py
skandaedutech's picture
Upload 31 files
13a32df verified
Raw
History Blame Contribute Delete
358 Bytes
import bcrypt
def verify_password(plain_password: str, hashed_password: str) -> bool:
if not hashed_password:
return False
return bcrypt.checkpw(plain_password.encode('utf-8'), hashed_password.encode('utf-8'))
def get_password_hash(password: str) -> str:
return bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')