ADD Verify_password

This commit is contained in:
Esa Kataja
2025-05-05 17:52:42 +03:00
parent df9c5ba4c0
commit c3494e6169
+4
View File
@@ -3,3 +3,7 @@ from hashlib import md5
def hash_password(password: str) -> str: def hash_password(password: str) -> str:
return md5(password.encode()).hexdigest() return md5(password.encode()).hexdigest()
def verify_password(password: str, hashed_password: str) -> bool:
return hash_password(password) == hashed_password