You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
382 B
14 lines
382 B
"""Authentication specific utilities."""
|
|
from typing import Tuple
|
|
|
|
from nacl import pwhash
|
|
|
|
|
|
def get_password_hash(password: str) -> Tuple[str, int]:
|
|
"""
|
|
Retrieve argon2id password hash.
|
|
|
|
:param password: plaintext password to convert
|
|
:return: Tuple[password_hash, password_revision]
|
|
"""
|
|
return pwhash.argon2id.str(password.encode('utf8')).decode('utf8'), 1
|