fnp
/
cas.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9217713
)
Add custom hasher.
author
Radek Czajka
<rczajka@rczajka.pl>
Fri, 18 Jan 2019 19:07:28 +0000
(20:07 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Fri, 18 Jan 2019 19:07:28 +0000
(20:07 +0100)
src/cas/hashers.py
[new file with mode: 0644]
patch
|
blob
diff --git a/src/cas/hashers.py
b/src/cas/hashers.py
new file mode 100644
(file)
index 0000000..
c7ae39a
--- /dev/null
+++ b/
src/cas/hashers.py
@@ -0,0
+1,8
@@
+from django.contrib.auth.hashers import BCryptPasswordHasher
+
+
+class FNPBCryptPasswordHasher(BCryptPasswordHasher):
+ def salt(self):
+ bcrypt = self._load_library()
+ return bcrypt.gensalt(self.rounds, prefix=b"2a")
+