[issue4903] binascii.crc32()

David M. Beazley report at bugs.python.org
Sat Jan 10 13:12:03 CET 2009


David M. Beazley <beazley at users.sourceforge.net> added the comment:

Placing a note in the standard library documentation would be a start.   
Just say in Python 3.0 it always returns the result as an unsigned 
integer whereas in Python 2.6 a 32-bit signed integer is returned. 
Although the numerical value may differ between versions, the underlying 
bits are the same.  Use crc32() & 0xffffffff to get a consistent value 
(already noted).

Note: Not everyone uses checksums in only a packed-binary format.  
Having the integer value just change across Python  versions like that 
is a real subtle compatibility problem to point out.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4903>
_______________________________________


More information about the Python-bugs-list mailing list