crc8.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2018 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stddef.h>
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
42 uint8_t crc8(const uint8_t *data, size_t len, uint8_t poly, uint8_t seed);
43 
58 uint8_t crc8_lsb(const uint8_t *data, size_t len, uint8_t poly, uint8_t seed);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
uint8_t crc8_lsb(const uint8_t *data, size_t len, uint8_t poly, uint8_t seed)
Calculate a reflected CRC-8 (LSB first)
uint8_t crc8(const uint8_t *data, size_t len, uint8_t poly, uint8_t seed)
Calculate CRC-8 (MSB first)