Skip to content

Commit deb99dd

Browse files
committed
experiment with another name
1 parent 49bbb54 commit deb99dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mig/shared/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _is_unicode(val):
5555
return (type(val) == _TYPE_UNICODE)
5656

5757

58-
def encode_unicode_string(unicode_string):
58+
def _unicode_string_to_utf8_bytes(unicode_string):
5959
"""Convert a unicode string value to bytes."""
6060

6161
return codecs.encode(unicode_string, 'utf8')

mig/shared/pwcrypto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import time
4545

4646
from mig.shared.base import force_utf8, mask_creds, string_snippet
47-
from mig.shared.compat import encode_unicode_string
47+
from mig.shared.compat import _unicode_string_to_utf8_bytes
4848
from mig.shared.defaults import keyword_auto, RESET_TOKEN_TTL
4949

5050

@@ -119,7 +119,7 @@ def best_crypt_salt(configuration):
119119
def make_hash(password, _urandom=urandom):
120120
"""Generate a random salt and return a new hash for the password."""
121121
salt = b64encode(_urandom(SALT_LENGTH))
122-
password_bytes = encode_unicode_string(password)
122+
password_bytes = _unicode_string_to_utf8_bytes(password)
123123
password_hashed = hashlib.pbkdf2_hmac(HASH_FUNCTION,
124124
password_bytes, salt,
125125
COST_FACTOR, KEY_LENGTH)

0 commit comments

Comments
 (0)