summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2012-08-09 07:25:35 -0700
committerAlex Gaynor <alex.gaynor@rd.io>2012-08-09 07:26:11 -0700
commit5f8da527abf6ce1d995d4f6454a07f7e442f7fd5 (patch)
treeb6975bfaaff2ff4ecb5fe83f0eddcf89f78c6018
parent5c09c59bc76510a5388623259b3827ee894cd66b (diff)
[py3k] use the base64 module, instead of bytes.encode('base64')
-rw-r--r--django/contrib/auth/hashers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/auth/hashers.py b/django/contrib/auth/hashers.py
index c676cf84db..45c1f88ab2 100644
--- a/django/contrib/auth/hashers.py
+++ b/django/contrib/auth/hashers.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+import base64
import hashlib
from django.dispatch import receiver
@@ -218,7 +219,7 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
if not iterations:
iterations = self.iterations
hash = pbkdf2(password, salt, iterations, digest=self.digest)
- hash = hash.encode('base64').strip()
+ hash = base64.b64encode(hash).strip()
return "%s$%d$%s$%s" % (self.algorithm, iterations, salt, hash)
def verify(self, password, encoded):