diff options
Diffstat (limited to 'passlib/handlers/digests.py')
-rw-r--r-- | passlib/handlers/digests.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/passlib/handlers/digests.py b/passlib/handlers/digests.py index 982155c..d9bf283 100644 --- a/passlib/handlers/digests.py +++ b/passlib/handlers/digests.py @@ -9,7 +9,6 @@ import logging; log = logging.getLogger(__name__) # site # pkg from passlib.utils import to_native_str, to_bytes, render_bytes, consteq -from passlib.utils.compat import unicode, str_to_uascii import passlib.utils.handlers as uh from passlib.crypto.digest import lookup_hash # local @@ -45,9 +44,9 @@ class HexDigestHash(uh.StaticHandler): return hash.lower() def _calc_checksum(self, secret): - if isinstance(secret, unicode): + if isinstance(secret, str): secret = secret.encode("utf-8") - return str_to_uascii(self._hash_func(secret).hexdigest()) + return self._hash_func(secret).hexdigest() #=================================================================== # eoc @@ -118,7 +117,7 @@ class htdigest(uh.MinimalHandler): if not encoding: encoding = cls.default_encoding uh.validate_secret(secret) - if isinstance(secret, unicode): + if isinstance(secret, str): secret = secret.encode(encoding) user = to_bytes(user, encoding, "user") realm = to_bytes(realm, encoding, "realm") |