Commit 5f8da527 authored by Alex Gaynor's avatar Alex Gaynor Committed by Alex Gaynor
Browse files

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

parent 5c09c59b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
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):