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():
|
for number, (status, time) in contacts.iteritems():
|
||||||
buddy = self[number]
|
buddy = self[number]
|
||||||
if status is None:
|
if status is None:
|
||||||
buddy.statusMessage = ""
|
buddy.statusMsg = ""
|
||||||
else:
|
else:
|
||||||
buddy.statusMsg = utils.softToUni(status)
|
buddy.statusMsg = utils.softToUni(status)
|
||||||
self.updateSpectrum(buddy)
|
self.updateSpectrum(buddy)
|
||||||
|
|
3
utils.py
3
utils.py
|
@ -24,6 +24,7 @@ u"""
|
||||||
import e4u
|
import e4u
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import base64
|
||||||
|
|
||||||
def ago(secs):
|
def ago(secs):
|
||||||
periods = [u"second", u"minute", u"hour", u"day", u"week", u"month", u"year", u"decade"]
|
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")))
|
return base64.b64decode(bytes(password.encode(u"utf-8")))
|
||||||
|
|
||||||
def sha1hash(data):
|
def sha1hash(data):
|
||||||
return hashlib.sha1(data).hexdigest()
|
return base64.b64encode(hashlib.sha1(data).digest())
|
||||||
|
|
Loading…
Reference in a new issue