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

Source code Version 2.1 is distributed under the terms of the GNU General Public License.

crcCode.h Header file for CRC. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
crcCode.cpp CRC code. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
shiftRegister.h Header file for shift register. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
View shiftRegister.cpp Implementation for shift register. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
View dataTypes.h Data types for the 32-bit parity bits and syndrome bits. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
View testCRC.cpp Main unit test program. Eye icon for source code viewing. View     Compact disk icon for source code download. Download
makefile Makefile for Cygwin. Eye icon for source code viewing. View     Compact disk icon for source code download. Download

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.