An open API service indexing awesome lists of open source software.

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.

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/