Skip to content
Snippets Groups Projects
Commit 981ba106 authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

compact sha make digest an unicode string

parent 2d5181f5
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,11 @@ class CompactHash(object):
self._proto = proto
def b64digest(self):
return base64.b64encode(self.digest(), "-_")[:-2]
return base64.b64encode(self.digest(), b"-_")[:-2].decode("ascii")
def b32digest(self):
res = base64.b32encode(self.digest())
return res[:res.index('=')]
return res[:res.index('=')].decode("ascii")
def update(self, data):
if type(data) == type(u""):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment