CRC-32 implementation in java.util.zip.CRC32

Dunxton picture Dunxton · Jan 25, 2012 · Viewed 11.6k times · Source

Which CRC-32 algorithm is used in the Java CRC-32 class ? The java doc does not give any details. What is the polynomail used and the initial value for calculaton ?

Answer

Dev picture Dev · Jan 25, 2012

CRC-32 is a indicated in the package docs for java.util.zip to be specified in RFC 1952. RFC 1952 defines CRC32 as specified in ISO 3309 which I could not find a free copy of to link you to. However RFC 1952 also indicates that section 8.1.1.6.2 of ITU-T recommendation V.42 specifies the same implementation.

In partcular the polynomial being used is

x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1