From 829ad28a66fae082f8d2e8df27164b52592a5ee6 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 6 Nov 2023 20:08:48 -0600 Subject: header stuff --- src/hash/crc.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/hash/crc.h') diff --git a/src/hash/crc.h b/src/hash/crc.h index d380235..de61efd 100644 --- a/src/hash/crc.h +++ b/src/hash/crc.h @@ -1,4 +1,32 @@ #include "../lua.h" +#include + +/** + * calculates a crc of (len) bytes + * + * @param {uint8_t*} input bytes + * @param {size_t} input length + * @return {uint8_t} 8 bit checksum +*/ +uint8_t i_crc8(uint8_t*, size_t); + +/** + * calculates a crc of (len) bytes + * + * @param {uint8_t*} input bytes + * @param {size_t} input length + * @return {uint16_t} 16 bit checksum +*/ +uint16_t i_crc16(uint8_t*, size_t); + +/** + * calculates a crc of (len) bytes + * + * @param {uint8_t*} input bytes + * @param {size_t} input length + * @return {uint32_t} 32 bit checksum +*/ +uint32_t i_crc32(uint8_t*, size_t); int l_crc8(lua_State*); int l_crc16(lua_State*); -- cgit v1.2.3