This is the mail archive of the
mailing list for the GCC project.
Re: Add crc32 function to libiberty
- From: DJ Delorie <dj at redhat dot com>
- To: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 24 Jul 2009 22:49:13 -0400
- Subject: Re: Add crc32 function to libiberty
- References: <20090725023920.0DEDA73F7C@caffeine.csclub.uwaterloo.ca>
> Your code uses the (one and only) CRC-32 polynomial 0x04c11db7, so just
> describing it as the "CRC-32" function should be sufficient documentation.
> It's the same CRC function as used by PKZIP, Ethernet, and chksum.
> It's not compatible with the Intel CRC32 instruction which uses the
> CRC-32C polynomial (0x1EDC6F41).
The fact that you describe it as "the one and only" - and then
describe a *second* polynomial - kinda proves my point about needing
My paranoia about this comes from trying to find the "right" CRC16 for
reading SD cards. There were a number to choose from :-P