fix session
This commit is contained in:
parent
7d277a8ad5
commit
7ff24d717d
3 changed files with 25 additions and 12 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue