> This raises a question: what should crc32 and adler32 return? They return > 32-bit values, and that's part of external definitions so we can't change > that, but how we *view* "the sign bit" is up to us. binascii.crc32() > always-- even on 64-bit boxes --returns a value in range(-2**31, 2**31). I > know that because I forced it to not long ago. I don't know what the other > guys return (zlib.crc32(), zlib.adler32(), ...?). > > It would sure be nice if they returned values in range(0, 2**32) instead. A > difficulty with changing this stuff is that checksums seem frequently to be > read and written via the struct module, with format code "l", and e.g. > > >>> struct.pack("!l", 1L << 31) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > OverflowError: long int too large to convert to int > >>> Such programs will have to be changed to use format code "L" instead. Or perhaps "l" should be allowed to accept longs in range(-2**31, 2**32) ? --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4