binascii.crc32 results not matching

Tim Peters tim.peters at gmail.com
Sat Dec 10 09:13:21 EST 2005


[Raymond L. Buvel]
> Check out the unit test in the following.
>
> http://sourceforge.net/projects/crcmod/

Cool!

> I went to a lot of trouble to get the results to match the results of
> binascii.crc32.  As you will see, there are a couple of extra operations
> even after you get the polynomial and bit ordering correct.

Nevertheless, the purpose of binascii.crc32 is to compute exactly the
same result as most zip programs give.  All the details (including
what look to you like "extra operations" ;-)) were specified by RFC
1952 (the GZIP file format specification).  As a result,
binascii.crc32 matches, e.g., the CRCs reported by WinZip on Windows,
and gives the same results as zlib.crc32 (as implemented by the zlib
developers).



More information about the Python-list mailing list