summaryrefslogtreecommitdiff
path: root/app/utils/hash_cfg.py
blob: 9937c99a56f56142d11fe688a51dcfe1e4d60069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from passlib.hash import argon2

argon2_hasher = argon2.using(
    type="ID",
    time_cost=3,
    memory_cost=65536,
    parallelism=4,
)


def hash_password(password: str) -> str:
    return argon2_hasher.hash(password)


def verify_password(password: str, hashed: str) -> bool:
    return argon2_hasher.verify(password, hashed)