android app

This commit is contained in:
rjb
2026-03-07 09:01:00 +08:00
parent 9d3198f6bc
commit 717cd2a1ac
63 changed files with 3067 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
"""
Password hashing and validation utilities.
"""
import bcrypt
def hash_password(password: str) -> str:
return bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt()).decode("utf-8")
def check_password(password: str, password_hash: str) -> bool:
return bcrypt.checkpw(password.encode("utf-8"), password_hash.encode("utf-8"))