Note:
|
CRC is used primarily for verification of a data stream. Since the function's algorithm uses all the elements of the input string for the calculation, the result can serve as a reliable measure for ensuring that the string is not altered.
A common application for CRC is communication between two computers. In order to verify that the data transmitted has actually arrived intact, calculate a CRC value from the data prior to transmission. Then append the CRC word (2 bytes) to the information, and transmit. On the receiving side, strip off the CRC information, and calculate a CRC value of the remaining data. If the CRC calculated from the received data and the CRC received with the data match, then there were no faults detected during transmission. If the two CRC values do not match, then the data probably was corrupted during transmission.
|