The currently accepted answer is incorrect.
The initial value for the Java class, CRC32 is 0, not 0xFFFFFFFF, as can be seen in the source code for the reset function:
public void reset() { crc = 0; }
https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/zip/CRC32.java#L81
I did a quick brute force search, and it turns out that updating the CRC with a value of 0xFFFFFFFF actually give the same value. Therefore, if you want the CRC32 algorithm to have an initial value of 0xFFFFFFFF , simply do:
CRC32 crc = new CRC32(); // Set the initial value to 0xFFFFFFFF crc.update(new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}); System.out.println("CRC: " + crc.getValue()); // prints 4294967295, which is 0xFFFFFFFF
source share