From 348a49db7529ff2c927d1cc943c7d354469902ca Mon Sep 17 00:00:00 2001 From: Wang Yaofu Date: Wed, 25 Aug 2021 18:49:15 +0800 Subject: [PATCH] add crc8 --- crc/crc8.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 crc/crc8.h diff --git a/crc/crc8.h b/crc/crc8.h new file mode 100644 index 0000000..3a88d71 --- /dev/null +++ b/crc/crc8.h @@ -0,0 +1,19 @@ +#ifndef _CRC_CRC8_H +#define _CRC_CRC8_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +// LSB-first +uint8_t crc8_lsb(const char *buf, int len); + +// MSB-first +uint8_t crc8_msb(const char *buf, int len); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif