CRC Checksum Using Long (64-bit)

I checked various implementations of CRC64. For example, this , this and this . The problem is that they work with bytes. However, on a 64-bit system, I would like to work with long (8 bytes). This way I will need less iteration. For example, the data of 128 bytes using byte , I need to iterate 128 times, and at long I will need to be repeated only 16 times.

Is there a CRC64 implementation that uses long or even a word size larger than a byte? Can these schemes be changed for this?

+6
source share
1 answer

CRC calculation uses a trick to avoid the need to process data in stages: it uses a lookup table that allows you to process multiple bits at once.

Processing bits n immediately requires a lookup table of size 2^n . The implementations you linked read 1 byte (8 bits) at a time, and indeed, they all use a lookup table of size 256 == 2 ^ 8.

To process 64 bits at a time, you need a lookup table of size 2 ^ 64, which is impractical. This is why common CRC implementations process 1 byte at a time.

While it is possible to process 2 bytes at a time using an array with an array of 65536, this can adversely affect performance due to the use of more processor cache memory.

+13
source

Source: https://habr.com/ru/post/909748/


All Articles