I have created following test-case in CRCTest to verify incremental CRC32C checksum computation.
@Test
public void testCRC32CIncremental() {
IncrementalIntHash crc32c = PROVIDER.getIncrementalInt(CRC32C);
String data = "data";
String combine = data + data;
int combineChecksum = crc32c.calculate(combine.getBytes());
int dataChecksum = crc32c.calculate(data.getBytes());
int incrementalChecksum = crc32c.resume(dataChecksum, data.getBytes());
assertEquals(combineChecksum, incrementalChecksum);
}
We have two separate ByteBuffers and we want to compute combined-checksum on it so, I am trying to use incremental checksum but it seems it is giving incorrect result. @trevorr Can you please advice if I am missing anything here.
Hi,
I have created following test-case in CRCTest to verify incremental CRC32C checksum computation.
We have two separate ByteBuffers and we want to compute combined-checksum on it so, I am trying to use incremental checksum but it seems it is giving incorrect result. @trevorr Can you please advice if I am missing anything here.