From 47fd81a5910eab3483f79d03eedf9307bc81252f Mon Sep 17 00:00:00 2001 From: l3wdfut4pwr Date: Tue, 17 Mar 2026 14:11:45 +0200 Subject: simple registration prototype --- app/utils/hash_cfg.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/utils/hash_cfg.py (limited to 'app/utils/hash_cfg.py') 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) -- cgit v1.3-3-g829e