https://github.com/ckormanyos/crc-catalog
crc-catalog implements numerous CRCs in C/C++ with a bitwise template-based algorithm.
https://github.com/ckormanyos/crc-catalog
crc crc-algorithms crc-calculation crc16 crc32 crc64 crc8
Last synced: 16 days ago
JSON representation
crc-catalog implements numerous CRCs in C/C++ with a bitwise template-based algorithm.
- Host: GitHub
- URL: https://github.com/ckormanyos/crc-catalog
- Owner: ckormanyos
- License: bsl-1.0
- Created: 2018-12-02T20:58:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-16T13:48:16.000Z (2 months ago)
- Last Synced: 2025-04-10T01:14:45.426Z (16 days ago)
- Topics: crc, crc-algorithms, crc-calculation, crc16, crc32, crc64, crc8
- Language: C++
- Homepage:
- Size: 40 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE_1_0.txt
Awesome Lists containing this project
README
# crc-catalog
crc-catalog implements numerous CRCs using a bitwise algorithm implemented as a single C++ template. This can be useful for verifying existing or new CRC algorithms. Well-known CRCs are implemented as specific functions with intuitive names. There are function bindings for both the C++ as well as the C language.
Using crc-catalog is straightforward. For instance, let's calculate the standard check of CRC16/CCITT-FALSE
```C
#include
#include
#include#include
int main()
{
const std::array crc_test_data =
{{
0x31U, 0x32U, 0x33U, 0x34U, 0x35U, 0x36U, 0x37U, 0x38U, 0x39U
}};const std::uint16_t crc_result =
crc::catalog::crc_crc16_ccitt_false(crc_test_data.data(), crc_test_data.size());const bool crc_result_is_ok = (crc_result == UINT16_C(0x29B1));
std::cout << "crc_result_is_ok: " << std::boolalpha << crc_result_is_ok << std::endl;
}
```
For additional information on the parameters and origins of most of these CRCs implemented in this repo, see also http://reveng.sourceforge.net/crc-catalogue/