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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/***
8-bit Cyclic Redundancy Check
@classmod a.crc8
*/
#ifndef LUA_LIBA_CRC8_H
#define LUA_LIBA_CRC8_H
#include "a.h"
/***
8-bit Cyclic Redundancy Check
@field table Cyclic Redundancy Check comparison table
@table a.crc8
*/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/***
constructor for 8-bit Cyclic Redundancy Check
@tparam integer poly polynomial that is CRC's divisor
@tparam boolean reversed whether or not to reverse
@treturn a.crc8 8-bit Cyclic Redundancy Check userdata
@function new
*/
int liba_crc8_new(lua_State *L);
/***
generate for 8-bit Cyclic Redundancy Check
@tparam integer poly polynomial that is CRC's divisor
@tparam boolean reversed whether or not to reverse
@treturn a.crc8 8-bit Cyclic Redundancy Check userdata
@function gen
*/
int liba_crc8_gen(lua_State *L);
/***
calculate for 8-bit Cyclic Redundancy Check
@tparam string block block to be processed
@tparam integer value initial value
@treturn integer output value
@function eval
*/
int liba_crc8_eval(lua_State *L);
/***
pack a block and its 8-bit Cyclic Redundancy Check value
@tparam string block block to be processed
@tparam integer value initial value
@treturn string packed block
@function pack
*/
int liba_crc8_pack(lua_State *L);
#if defined(__cplusplus)
} /* extern "C" */
#endif /* __cplusplus */
#endif /* crc8.h */