diff options
| author | ame <[email protected]> | 2023-11-06 20:08:48 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2023-11-06 20:08:48 -0600 |
| commit | 4fc59207afdf442cd769992339b7fdea0ff2a2b8 (patch) | |
| tree | 82df02dd802224f330470b2479afe24af14b3527 /src/hash/crc.h | |
| parent | d062e57c154b2bed76276d52681577028e859677 (diff) | |
header stuff
Diffstat (limited to 'src/hash/crc.h')
| -rw-r--r-- | src/hash/crc.h | 28 |
1 files changed, 28 insertions, 0 deletions
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 <stdint.h> + +/** + * 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*); |
