Calculate a 32-bit CRC lookup table in C/C++
问题 I want to calculate a 32-bit CRC lookup table. One way I tried is by using the following code from this website: #include <iostream> #include <stdint.h> void make_crc_table() { unsigned long POLYNOMIAL = 0x04c11db7; unsigned long WIDTH = 8 * sizeof(unsigned long); unsigned long TOPBIT = 1 << (WIDTH - 1); unsigned long crcTable[256]; unsigned long remainder; // Compute the remainder of each possible dividend for (int dividend = 0; dividend < 256; ++dividend) { // Start with the dividend