These days in the study of CRC32 calculation process, see the principle of CRC algorithm, but also see a lot of code implemented by the shift method, but the results are calculated with the calibration tool is inconsistent.
Toss for a long time, finally found a manual calculation CRC32 article, and then against the IEEE 802.3 standard CRC calculation process, only calculate the CRC32 calculation.
Here is a note of the main points of the calculation process:
1) CRC32 is a CRC algorithm, first refer to the principles and examples of CRC algorithm on the wiki to understand the basic calculation method.
2) The most common CRC32 algorithm is the one used in IEEE 802.3 to generate FCS fields:
A) The polynomial used by CRC32 is
b) IEEE 802.3 uses the least significant bit precedence (least significant bit first) when transmitting data, so it is necessary to convert to a valid Bitstream input based on the architecture of your machine. Similarly, the output stream is the same.
c) In order to effectively identify the beginning and end of the input stream 0, the beginning of the 32 bits to be reversed (complement), the last calculated remainder also to the bitwise inverse.
According to the above method calculation can get the desired CRC32 value.
CRC32 Algorithm Notes