https://github.com/mattsta/crcspeed/blob/master/crcspeed.c#L32
/* Fill in a CRC constants table. */ void crcspeed64little_init(crcfn64 crcfn, uint64_t table[8][256]) { uint64_t crc; /* generate CRCs for all single byte sequences */ for (int n = 0; n < 256; n++) { table[0][n] = crcfn(0, &n, 1); } /* generate nested CRC table for future slice-by-8 lookup */ for (int n = 0; n < 256; n++) { crc = table[0][n]; for (int k = 1; k < 8; k++) { crc = table[0][crc & 0xff] ^ (crc >> 8); table[k][n] = crc; } } }
Pre lorem ipsum z unit testu to bude asi signifikantny cas, ale pre 700MB+ subor z vyssie uvedeneho testu to nebude nic strasne.