0
votes

Another zlib CRC Combine related question :P I want to be able to combine CRC(X) + CRC(Y) = CRC(Z), problem is that I don't know what CRC(Y) is supposed to be. Is there somehow that I can say use CRC(X) and CRC(Z) to get what CRC(Y) is supposed to be? Total sizes are known at this point in time (e.g. CRC(X) will be say 40 bytes, CRC(Z) should be 100 bytes so CRC(Y) is 60 bytes long)

1

1 Answers

1
votes

Yes. zlib's crc32_combine64() function has one line:

return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;

If we call the total CRC crc3, then you can get crc2 simply as:

crc2 = multmodp(x2nmodp(len2, 3), crc1) ^ crc3;