Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[py3k] use the base64 module, instead of bytes.encode('base64')

  • Loading branch information...
commit 5f8da527abf6ce1d995d4f6454a07f7e442f7fd5 1 parent 5c09c59
@alex alex authored Alex Gaynor committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/contrib/auth/hashers.py
View
3  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 @@ def encode(self, password, salt, iterations=None):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.