From 68302c7b34fabd100e3b1b39e805492b631d0f04 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 18 Jan 2019 20:07:28 +0100 Subject: [PATCH] Add custom hasher. --- src/cas/hashers.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/cas/hashers.py diff --git a/src/cas/hashers.py b/src/cas/hashers.py new file mode 100644 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") + -- 2.20.1