aboutsummaryrefslogtreecommitdiff
path: root/src/hash/crc.h
diff options
context:
space:
mode:
authorame <[email protected]>2023-11-06 20:08:48 -0600
committerame <[email protected]>2023-11-06 20:08:48 -0600
commit4fc59207afdf442cd769992339b7fdea0ff2a2b8 (patch)
tree82df02dd802224f330470b2479afe24af14b3527 /src/hash/crc.h
parentd062e57c154b2bed76276d52681577028e859677 (diff)
header stuff
Diffstat (limited to 'src/hash/crc.h')
-rw-r--r--src/hash/crc.h28
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*);