-
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 for a Lua string. It currently supports the following different crcs:
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 0xFF
- ....
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 0xFF
- ....
Returns: crc-code of the lua string
/ > crc.crc32("test")
113532655