java.util.zip.CRC32中的CRC-32实现 [英] CRC-32 implementation in java.util.zip.CRC32
问题描述
Java CRC-32类中使用了哪种CRC-32算法? Java文档未提供任何详细信息。
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 ?
推荐答案
根据源:
计算数据流的CRC32数据校验和。实际的CRC32
算法在RFC 1952(GZIP文件格式规范
版本4.3)中进行了描述。如果将
与检查的输入/输出流一起使用,则可用于获取流上的CRC32。
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.
RFC1952可以是在此处中找到,但是介绍了相当技术性的内容。
The RFC1952 can be found here, but presents a quite technical read.
CRC的初始值为 0xFFFFFFFF
,并且在首次将类加载到VM时构建CRC表。
The initial value for the CRC is 0xFFFFFFFF
, and the CRC table is built the first time the class is loaded on the VM.
这篇关于java.util.zip.CRC32中的CRC-32实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!