aboutsummaryrefslogtreecommitdiff
path: root/src/hash/pearson.h
diff options
context:
space:
mode:
authorame <[email protected]>2024-04-04 10:06:53 -0500
committerame <[email protected]>2024-04-04 10:06:53 -0500
commitdae9e34168b56a399b2b1e04e657e322b9c6f803 (patch)
tree174eef159441750b71e720d6639b9b221502fd1c /src/hash/pearson.h
parent35c37ef1221d5860731435137059dc4533adff42 (diff)
all basic hash funcs
Diffstat (limited to 'src/hash/pearson.h')
-rw-r--r--src/hash/pearson.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/hash/pearson.h b/src/hash/pearson.h
index 646e6dd..4cdfda9 100644
--- a/src/hash/pearson.h
+++ b/src/hash/pearson.h
@@ -1,13 +1,17 @@
#include "../lua.h"
#include <stdint.h>
-/**
- * calculates a pearson hash of (len) bytes
- *
- * @param {uint8_t*} input bytes
- * @param {size_t} input length
- * @return {uint8_t} 8 bit hash
-*/
-uint8_t i_pearson(uint8_t*,size_t);
+
+struct pearson_hash {
+ uint8_t ret;
+};
+
+struct pearson_hash pearson_init();
+void pearson_update(uint8_t*, size_t, struct pearson_hash* hash);
+uint8_t pearson_final(struct pearson_hash* hash);
+uint8_t pearson(uint8_t*,size_t);
int l_setpearson(lua_State* L);
int l_pearson(lua_State* L);
+int l_pearson_init(lua_State* L);
+int l_pearson_update(lua_State* L);
+int l_pearson_final(lua_State* L);