Add custom hasher.
[cas.git] / src / cas / hashers.py
diff --git a/src/cas/hashers.py b/src/cas/hashers.py
new file mode 100644 (file)
index 0000000..c7ae39a
--- /dev/null
@@ -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")
+