aiverse / app /core /__init__.py
junaidte14's picture
aiverse backend to hf
3821102
Raw History Blame Contribute Delete
413 Bytes
from pwdlib import PasswordHash
# Initialize the modern handler
password_hash = PasswordHash.recommended()
def hash_password(password: str) -> str:
"""Hash a password for storage."""
return password_hash.hash(password)
def verify_password(plain_password: str, hashed_password: str) -> bool:
"""Verify a password against a hash."""
return password_hash.verify(plain_password, hashed_password)