blob: c77bce407dd657a6371e0e791646725626164412 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "../lua.h"
#include <stdint.h>
/**
* calculates a fletcher hash of (len) bytes
*
* @param {uint8_t*} input bytes
* @param {size_t} input length
* @return {uint8_t} 8 bit hash
*/
uint8_t i_fletcher8(uint8_t*,size_t);
/**
* calculates a fletcher hash of (len) bytes
*
* @param {uint8_t*} input bytes
* @param {size_t} input length
* @return {uint16_t} 16 bit checksum
*/
uint16_t i_fletcher16(uint8_t*,size_t);
/**
* calculates a fletcher hash of (len) bytes
*
* @param {uint8_t*} input bytes
* @param {size_t} input length
* @return {uint32_t} 32 bit checksum
*/
uint32_t i_fletcher32(uint8_t*,size_t);
int l_fletcher32(lua_State*);
int l_fletcher16(lua_State*);
int l_fletcher8(lua_State*);
|