refactor: update hash_password and verify_password to use algorithm interface

This commit is contained in:
2025-11-13 13:18:22 +00:00
parent 6ca905cd1e
commit c85c68f859
2 changed files with 15 additions and 25 deletions

View File

@@ -18,3 +18,9 @@ def test_hash_password_returns_base64() -> None:
def test_verify_password_handles_invalid_base64() -> None:
assert verify_password("secret", "**invalid**", "???") is False
def test_hash_password_with_algorithm_parameter():
"""Verify hash_password accepts algorithm parameter."""
salt, hashed = hash_password("test", algorithm="pbkdf2")
assert verify_password("test", salt, hashed, algorithm="pbkdf2")