Use base64 sha1hash instead of base16
This commit is contained in:
parent
3781dcfc1c
commit
bed8214a11
2
buddy.py
2
buddy.py
|
@ -108,7 +108,7 @@ class BuddyList(dict):
|
|||
for number, (status, time) in contacts.iteritems():
|
||||
buddy = self[number]
|
||||
if status is None:
|
||||
buddy.statusMessage = ""
|
||||
buddy.statusMsg = ""
|
||||
else:
|
||||
buddy.statusMsg = utils.softToUni(status)
|
||||
self.updateSpectrum(buddy)
|
||||
|
|
3
utils.py
3
utils.py
|
@ -24,6 +24,7 @@ u"""
|
|||
import e4u
|
||||
import base64
|
||||
import hashlib
|
||||
import base64
|
||||
|
||||
def ago(secs):
|
||||
periods = [u"second", u"minute", u"hour", u"day", u"week", u"month", u"year", u"decade"]
|
||||
|
@ -50,4 +51,4 @@ def decodePassword(password):
|
|||
return base64.b64decode(bytes(password.encode(u"utf-8")))
|
||||
|
||||
def sha1hash(data):
|
||||
return hashlib.sha1(data).hexdigest()
|
||||
return base64.b64encode(hashlib.sha1(data).digest())
|
||||
|
|
Loading…
Reference in a new issue