From b8b5f8c7725d7431b82cb065b2b18891c1bc3fc9 Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 4 Apr 2024 10:06:53 -0500 Subject: all basic hash funcs --- src/hash/pearson.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/hash/pearson.h') 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 -/** - * 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); -- cgit v1.2.3