security.py 326 B

1234567891011
  1. from passlib.context import CryptContext
  2. pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
  3. def verify_password(plain_password: str, hashed_password: str) -> bool:
  4. return pwd_context.verify(plain_password, hashed_password)
  5. def hash_password(password: str) -> str:
  6. return pwd_context.hash(password)