Here is an article that describes how to calculate CRC32 of maximum 1024 bytes using the built in CRC32 instruction found in modern x86-64 processors. However, I need to calculate CRC32 of more than 1024 bytes. Would it be a correct approach to calculate CRC32 of each block of 1024 bytes and in the end sum them, or is it incorrect? If so, what is the correct way to do it?
Share
No, just adding won’t do the job.
The article you linked tells us how to do it:
To cover the case of the final result being larger then
0xffffffffjust docrc32 = ~crc32 & 0xffffffffafter the final calculation.