📄 e456. calculating the checksum of a byte array.txt
字号:
byte[] bytes = "some data".getBytes();
// Compute Adler-32 checksum
Checksum checksumEngine = new Adler32();
checksumEngine.update(bytes, 0, bytes.length);
long checksum = checksumEngine.getValue();
// Compute CRC-32 checksum
checksumEngine = new CRC32();
checksumEngine.update(bytes, 0, bytes.length);
checksum = checksumEngine.getValue();
// The checksum engine can be reused again for a different byte array by calling reset()
checksumEngine.reset();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -