порт лабы 4

This commit is contained in:
2026-11-05 19:18:07 +03:00
parent 276dbdad8a
commit a7063868a4
28 changed files with 3074 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