Module liba.crc64
64-bit Cyclic Redundancy Check
Functions
new (poly, reversed) | constructor for 64-bit Cyclic Redundancy Check |
gen (ctx, poly, reversed) | generate for 64-bit Cyclic Redundancy Check |
eval (ctx, block, value) | calculate for 64-bit Cyclic Redundancy Check |
pack (ctx, block, value) | pack a block and its 64-bit Cyclic Redundancy Check value |
Functions
- new (poly, reversed)
-
constructor for 64-bit Cyclic Redundancy Check
Parameters:
- poly integer polynomial that is CRC's divisor
- reversed boolean whether or not to reverse
Returns:
-
a.crc64
64-bit Cyclic Redundancy Check userdata
- gen (ctx, poly, reversed)
-
generate for 64-bit Cyclic Redundancy Check
Parameters:
- ctx a.crc64 64-bit Cyclic Redundancy Check userdata
- poly integer polynomial that is CRC's divisor
- reversed boolean whether or not to reverse
Returns:
-
a.crc64
64-bit Cyclic Redundancy Check userdata
- eval (ctx, block, value)
-
calculate for 64-bit Cyclic Redundancy Check
Parameters:
- ctx a.crc64 64-bit Cyclic Redundancy Check userdata
- block string block to be processed
- value integer initial value
Returns:
-
integer
output value
- pack (ctx, block, value)
-
pack a block and its 64-bit Cyclic Redundancy Check value
Parameters:
- ctx a.crc64 64-bit Cyclic Redundancy Check userdata
- block string block to be processed
- value integer initial value
Returns:
-
string
packed block