diff options
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*); |
