mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 19:50:34 +00:00
13 lines
377 B
Python
13 lines
377 B
Python
from passlib.context import CryptContext
|
|
|
|
password = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
|
|
|
|
def password_hash(password_value: str):
|
|
return password.hash(password_value)
|
|
|
|
|
|
def password_verify(password_value: str, password_hash: str | None):
|
|
if not password_hash:
|
|
return False
|
|
return password.verify(password_value, password_hash)
|