GENERATING AND CHECKING CRC CODES


Overview

C++ software for a program which generates and checks CRC (Cyclic Redundancy Check) codes.

Features:

  • Can work with any size CRC code up to 32 bits.
  • Well commented source code, easy to extend.

Drawbacks:

  • Not optimized for speed yet --- I'm working a table lookup method.

References:

I have a mathematical CRC tutorial and some encoding and syndrome calculation examples: Part 1, Part 2, Part 2.

Ross Williams has description of various CRC implementations.

Download Source Code

CRDemo Version 2.1 Compact disk icon for source code download. source code and executables are distributed under the terms of the GNU General Public License.

testCRC.cpp contains the main program. crcCode.cpp and crcCode.h contains the CRC code top level implementation, while shiftRegister.cpp and shiftRegister.h implement the feedback shift register. View dataTypes.h contains the data types for the 32-bit parity bits and syndrome bits. makefile is the makefile for macOS, Linux (Ubuntu) and Windows/Cygwin.

Install and Run

On Mac OS X, I use the Xcode IDE; on a Windows platforms, I use the GNU Cygwin toolset for command line compiling and debugging; and on Unix systems, including Mac OS X, I use the built-in gcc compiler and gdb debugger. For online C++ language tutorials, books and references, see links to C++ documentation.