-
Notifications
You must be signed in to change notification settings - Fork 225
CRC module
Thomas E. Horner edited this page Mar 18, 2019
·
4 revisions
This module contains functions for creating a CRC checksum for a Lua string. It currently supports the following different crc checksum types:
Create an 8-bit crc code for the text.
Arguments:
- text: the lua string to create the crc for
- init-value (optional): init value to begin the crc calculation with. default is 0xFF
Returns: crc-code of the lua string
/ > crc.crc8("test")
140
Create an 16-bit crc code for the text.
Arguments:
- text: the lua string to create the crc for
- init-value (optional): init value to begin the crc calculation with. default is 0xFFFF
Returns: crc-code of the lua string
/ > crc.crc16("test")
1193
Create an 32-bit crc code for the text.
Arguments:
- text: the lua string to create the crc for
- init-value (optional): init value to begin the crc calculation with. default is 0xFFFFFFFF
Returns: crc-code of the lua string
/ > crc.crc32("test")
113532655