Calculate Generic CRC
v = crc.calc(init, polyrev, xor, txt)
Calculate a general purpose CRC (up to CRC-32).
Parameter | Type | Description |
---|---|---|
init |
integer | Initial value |
polyrev |
integer | The polynomial value, reversed. Use negative values when the input and output are reflected. |
xor |
integer | The value to XOR at the end |
txt |
string | The text to CRC |
Examples:
crc.calc(0xffffffff, -0xedb88320, 0xffffffff, txt)
crc.calc(0xffff, -0xa001, 0, txt)
crc.calc(0xffff, 0x8408, 0, txt)
crc.calc(0, 0x8408, 0, txt)
crc.calc(0, -0xa6bc, 0xffff, txt)