pylord/API-BFSI
0
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 