fix adler32 iterations
This commit is contained in:
parent
2a233d519f
commit
709cf93b75
1 changed files with 2 additions and 2 deletions
|
|
@ -467,14 +467,14 @@ class adler32_constructor(object):
|
|||
|
||||
#mimicing the hashlib constructors
|
||||
def __init__(self, arg=''):
|
||||
if six.PY3:
|
||||
if six.PY3 and isinstance(arg, str):
|
||||
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:
|
||||
if six.PY3 and isinstance(arg, str):
|
||||
arg = bytes(arg, 'utf-8')
|
||||
self._value = adler32(arg, self._value) & 0xffffffff
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue