CoolFace
Apppublic

pylord/API-BFSI

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes
auth.py10 linesDownload Raw Back to utils
1import bcrypt2 3def hash_password(password: str) -> str:4    """Hashes a plain text password."""5    return bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt()).decode("utf-8")6 7def verify_password(plain_password: str, hashed_password: str) -> bool:8    """Verifies if a plain password matches the hashed one."""9    return bcrypt.checkpw(plain_password.encode("utf-8"), hashed_password.encode("utf-8"))10