summaryrefslogtreecommitdiff
path: root/Projekt/app/utils.py
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2022-02-06 13:10:32 +0200
committerRasmus Luha <rasmus.luha@gmail.com>2022-02-06 13:10:32 +0200
commit5e19a0569288de21365c61b0db78639880732dd0 (patch)
treee1d3add7376b53157fe8830cbd81b02c1a3a3586 /Projekt/app/utils.py
inital commit
Diffstat (limited to 'Projekt/app/utils.py')
-rw-r--r--Projekt/app/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Projekt/app/utils.py b/Projekt/app/utils.py
new file mode 100644
index 0000000..3cd58bf
--- /dev/null
+++ b/Projekt/app/utils.py
@@ -0,0 +1,9 @@
+
+from passlib.context import CryptContext # passwordide hashimise jaoks
+
+pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
+def hash(password: str):
+ return pwd_context.hash(password)
+
+def verify(plain_password, hashed_password):
+ return pwd_context.verify(plain_password, hashed_password)