feat: implement bcrypt algorithm
This commit is contained in:
@@ -52,3 +52,17 @@ def test_argon2_algorithm_identifier():
|
||||
"""Verify Argon2 algorithm has correct identifier."""
|
||||
algo = get_algorithm("argon2")
|
||||
assert algo.identifier == "argon2"
|
||||
|
||||
|
||||
def test_bcrypt_algorithm_hash_round_trip():
|
||||
"""Verify bcrypt algorithm can hash and verify passwords."""
|
||||
algo = get_algorithm("bcrypt")
|
||||
salt, hashed = algo.hash("test password")
|
||||
assert algo.verify("test password", salt, hashed)
|
||||
assert not algo.verify("wrong password", salt, hashed)
|
||||
|
||||
|
||||
def test_bcrypt_algorithm_identifier():
|
||||
"""Verify bcrypt algorithm has correct identifier."""
|
||||
algo = get_algorithm("bcrypt")
|
||||
assert algo.identifier == "bcrypt"
|
||||
|
||||
Reference in New Issue
Block a user