Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetuludag committed May 19, 2015
1 parent 1b84156 commit af9b558
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userena/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def generate_sha1(string, salt=None):
if not salt:
salt = sha_constructor(str(random.random()).encode('utf-8')).hexdigest()[:5]

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

return salt, hash_
Expand Down

0 comments on commit af9b558

Please sign in to comment.