13 lines
223 B
Python
13 lines
223 B
Python
from argon2 import PasswordHasher
|
|
|
|
ph = PasswordHasher()
|
|
|
|
def digest(password):
|
|
return ph.hash(password)
|
|
|
|
def verify(expected, given):
|
|
try:
|
|
return ph.verify(expected, given)
|
|
except:
|
|
return False
|