From: Radek Czajka Date: Fri, 18 Jan 2019 19:07:28 +0000 (+0100) Subject: Add custom hasher. X-Git-Url: https://git.mdrn.pl/cas.git/commitdiff_plain/68302c7b34fabd100e3b1b39e805492b631d0f04?ds=inline Add custom hasher. --- 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") +