diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
| commit | 47fd81a5910eab3483f79d03eedf9307bc81252f (patch) | |
| tree | 3e1ebd1bddcea649eb968e65161555afd4c2898c /app/utils/hash_cfg.py | |
| parent | f01cb6703710b7df4c7c022047cd35e1d5e9c70e (diff) | |
simple registration prototype
Diffstat (limited to 'app/utils/hash_cfg.py')
| -rw-r--r-- | app/utils/hash_cfg.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/utils/hash_cfg.py b/app/utils/hash_cfg.py new file mode 100644 index 0000000..9937c99 --- /dev/null +++ b/app/utils/hash_cfg.py @@ -0,0 +1,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) |
