作者:顺佳海外 | 来源:互联网 | 2023-09-12 17:54
WhichCRC-32algorithmisusedintheJavaCRC-32class?Thejavadocdoesnotgiveanydetails.Whatisthepo
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 ?
解决方案
According to the source:
Computes CRC32 data checksum of a data stream. The actual CRC32
algorithm is described in RFC 1952 (GZIP file format specification
version 4.3). Can be used to get the CRC32 over a stream if used
with checked input/output streams.
The RFC1952 can be found here, but presents a quite technical read.
The initial value for the CRC is 0xFFFFFFFF, and the CRC table is built the first time the class is loaded on the VM.