порт из 3 лабы

This commit is contained in:
2026-10-28 16:10:43 +03:00
parent ec540a1a72
commit f3bcdad9e8
22 changed files with 2205 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
password_hasher = PasswordHasher()
def hash_password(password: str) -> str:
return password_hasher.hash(password)
def verify_password(password_hash: str, password: str) -> bool:
try:
return password_hasher.verify(password_hash, password)
except VerifyMismatchError:
return False