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