CRC-8 checksum algorithms. More...
CRC-8 checksum algorithms.
Files | |
file | crc8.h |
CRC-8 definitions. | |
Functions | |
uint8_t | crc8 (const uint8_t *data, size_t len, uint8_t poly, uint8_t seed) |
Calculate CRC-8 (MSB first) More... | |
uint8_t | crc8_lsb (const uint8_t *data, size_t len, uint8_t poly, uint8_t seed) |
Calculate a reflected CRC-8 (LSB first) More... | |
uint8_t crc8 | ( | const uint8_t * | data, |
size_t | len, | ||
uint8_t | poly, | ||
uint8_t | seed | ||
) |
Calculate CRC-8 (MSB first)
This CRC8 checksum type is usually more common.
[in] | data | Start of memory area to checksum |
[in] | len | Number of bytes in buf to calculate checksum for |
[in] | poly | The generator polynomial for the checksum |
[in] | seed | The seed (starting value) for the checksum |
uint8_t crc8_lsb | ( | const uint8_t * | data, |
size_t | len, | ||
uint8_t | poly, | ||
uint8_t | seed | ||
) |
Calculate a reflected CRC-8 (LSB first)
This CRC8 checksum type is used for example by Onewire.
[in] | data | Start of memory area to checksum |
[in] | len | Number of bytes in buf to calculate checksum for |
[in] | poly | The generator polynomial for the checksum |
[in] | seed | The seed (starting value) for the checksum |