Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 5f8da527abf6ce1d995d4f6454a07f7e442f7fd5 1 parent 5c09c59
Alex Gaynor alex authored Alex Gaynor committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/contrib/auth/
3  django/contrib/auth/
@@ -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.