12 lines
309 B
Python
12 lines
309 B
Python
import passlib.context
|
|
|
|
pwd_context = passlib.context.CryptContext(schemes=['bcrypt'])
|
|
|
|
|
|
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
|
return pwd_context.verify(plain_password, hashed_password)
|
|
|
|
|
|
def get_password_hash(password: str) -> str:
|
|
return pwd_context.hash(password)
|