Skip to content

Commit af9b558

Browse files
committed
Update utils.py
1 parent 1b84156 commit af9b558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

userena/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def generate_sha1(string, salt=None):
112112
if not salt:
113113
salt = sha_constructor(str(random.random()).encode('utf-8')).hexdigest()[:5]
114114

115-
salted_bytes = (salt.encode('utf-8') + string.encode('utf-8'))
115+
salted_bytes = (salt.encode('utf-8') + unicode(string,'utf-8').encode('utf-8'))
116116
hash_ = sha_constructor(salted_bytes).hexdigest()
117117

118118
return salt, hash_

0 commit comments

Comments
 (0)