NetWrok.HTTP.Zlib.CRC32.CRC32 C# (CSharp) Method

CRC32() static private method

static private CRC32 ( ) : System
return System
        static CRC32()
        {
            unchecked {
                // This is the official polynomial used by CRC32 in PKZip.
                // Often the polynomial is shown reversed as 0x04C11DB7.
                UInt32 dwPolynomial = 0xEDB88320;
                UInt32 i, j;

                crc32Table = new UInt32[256];

                UInt32 dwCrc;
                for (i = 0; i < 256; i++) {
                    dwCrc = i;
                    for (j = 8; j > 0; j--) {
                        if ((dwCrc & 1) == 1) {
                            dwCrc = (dwCrc >> 1) ^ dwPolynomial;
                        } else {
                            dwCrc >>= 1;
                        }
                    }
                    crc32Table [i] = dwCrc;
                }
            }
        }