CRC

<< Click to Display Table of Contents >>

Navigation:  Glossary / Terms Used >

CRC

Cyclic Redundancy Code. A CRC is a method to detect whether a received sequence/message has been corrupted, e.g. by transmission errors. This is done by constructing an additional checksum value that is a function of the message's payload data, and then appending this value to the original message. The receiver calculates the checksum from the received data and compares it to the transmitted CRC value to see if the message is unmodified. CRCs are commonly used because they allow the detection of typical transmission errors (bit errors, burst errors) with very high accuracy.

 

CRC algorithms are based on polynomial arithmetic, and come in many different versions. Common algorithms are CRC-CCITT, CRC-16 and CRC-32. An example of an application protocol that uses a CRC is Modbus over Serial Line.

 

A popular article about CRCs is "CRC Implementation Code in C" by Michael Barr, formerly published as "Slow and Steady Never Lost the Race" and "Easier Said Than Done":

https://barrgroup.com/Embedded-Systems/How-To/CRC-Calculation-C-Code

 

Docklight Scripting's CRC functionality (DL.CalcChecksum) was inspired by the above article and the proposed Boost CRC library:

http://www.boost.org/libs/crc/index.html

 

Last not least, if you are truly fascinated by CRC alchemy, you will sooner or later run into mentions of the following classic article from 1993:

"A Painless Guide to CRC Error Detection Algorithms" by Ross N. Williams:

http://ross.net/crc/crcpaper.html / http://ross.net/crc/download/crc_v3.txt