diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2012-08-09 07:25:35 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@rd.io> | 2012-08-09 07:26:11 -0700 |
| commit | 5f8da527abf6ce1d995d4f6454a07f7e442f7fd5 (patch) | |
| tree | b6975bfaaff2ff4ecb5fe83f0eddcf89f78c6018 | |
| parent | 5c09c59bc76510a5388623259b3827ee894cd66b (diff) | |
[py3k] use the base64 module, instead of bytes.encode('base64')
| -rw-r--r-- | django/contrib/auth/hashers.py | 3 |
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): |
