начало БД

This commit is contained in:
2025-11-29 14:51:45 +03:00
parent c48d1ee383
commit c59db5819f
23 changed files with 713 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def pwd_hash(pwd_plant: str) -> str:
return pwd_context.encrypt(pwd_plant)
def pwd_verify(pwd_plant: str, pwd_hash: str) -> bool:
from my_loggers import logger
try:
return pwd_context.verify(pwd_plant, pwd_hash)
except Exception as e:
logger.error(f"Password verification error: {str(e)}")
return False