fix session

This commit is contained in:
Tomas Kopecek 2017-05-03 13:51:22 +02:00
parent 7d277a8ad5
commit 7ff24d717d
3 changed files with 25 additions and 12 deletions

View file

@ -467,11 +467,15 @@ class adler32_constructor(object):
#mimicing the hashlib constructors
def __init__(self, arg=''):
if six.PY3:
arg = bytes(arg, 'utf-8')
self._value = adler32(arg) & 0xffffffff
#the bitwise and works around a bug in some versions of python
#see: https://bugs.python.org/issue1202
def update(self, arg):
if six.PY3:
arg = bytes(arg, 'utf-8')
self._value = adler32(arg, self._value) & 0xffffffff
def digest(self):