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
/***
32-bit Cyclic Redundancy Check
@classmod a.crc32
*/
#ifndef LUA_LIBA_CRC32_H
#define LUA_LIBA_CRC32_H
#include "a.h"
/***
32-bit Cyclic Redundancy Check
@field table Cyclic Redundancy Check comparison table
@table a.crc32
*/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/***
constructor for 32-bit Cyclic Redundancy Check
@tparam integer poly polynomial that is CRC's divisor
@tparam boolean reversed whether or not to reverse
@treturn a.crc32 32-bit Cyclic Redundancy Check userdata
@function new
*/
int liba_crc32_new(lua_State *L);
/***
generate for 32-bit Cyclic Redundancy Check
@tparam integer poly polynomial that is CRC's divisor
@tparam boolean reversed whether or not to reverse
@treturn a.crc32 32-bit Cyclic Redundancy Check userdata
@function gen
*/
int liba_crc32_gen(lua_State *L);
/***
calculate for 32-bit Cyclic Redundancy Check
@tparam string block block to be processed
@tparam integer value initial value
@treturn integer output value
@function eval
*/
int liba_crc32_eval(lua_State *L);
/***
pack a block and its 32-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_crc32_pack(lua_State *L);
#if defined(__cplusplus)
} /* extern "C" */
#endif /* __cplusplus */
#endif /* crc32.h */