summaryrefslogtreecommitdiff
path: root/app/utils/hash_cfg.py
diff options
context:
space:
mode:
authorl3wdfut4pwr <l3wdfut4pwr@gmail.com>2026-03-17 14:11:45 +0200
committerl3wdfut4pwr <l3wdfut4pwr@gmail.com>2026-03-17 14:11:45 +0200
commit47fd81a5910eab3483f79d03eedf9307bc81252f (patch)
tree3e1ebd1bddcea649eb968e65161555afd4c2898c /app/utils/hash_cfg.py
parentf01cb6703710b7df4c7c022047cd35e1d5e9c70e (diff)
simple registration prototype
Diffstat (limited to 'app/utils/hash_cfg.py')
-rw-r--r--app/utils/hash_cfg.py16
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)