A small command-line tool for calculating CRC values (up to CRC-32) for a given input.
The CRC (Cyclic Redundancy Check) algorithm is utilized to detect errors or corruption during data transmission. It is reliable since the receiver can verify data integrity using only the data itself and a generator polynomial known to both sender and receiver.
If you want to get a good (but not necessarily explicit) understanding of CRCs then refer to sunshine2k's article.
This project requires CMake and Ninja to build.
# Clone the repository
$ git clone https://github.com/cmodii/crc_cli
# Create a build directory
$ mkdir build
$ cd build
# Build the app
$ cmake ..
$ ninja
# Run the app
$ cli| Mode | Polynomial (hex) |
|---|---|
| crc32 | 0x4C11DB7 |
| crc16 | 0xA001 |
| crc8 | 0x7 |
Tip
You can modify the polynomial values in the checksum header file and the lookup tables for each CRC in their respective source files: crc8, crc16, crc32.
Running the command:
cli crc16 "CRC CLI in action"Produces: