Skip to content

Checksums

Function: Crc32

byte[] Crc32(byte[] data)

Description:
Calculates the CRC-32 checksum for the provided data.

Parameters:
- data: The byte array for which the CRC-32 checksum should be calculated.

Return Value:
Returns a byte array containing the CRC-32 checksum.

Usage Example
1
2
3
byte[] inputData = {0x01, 0x02, 0x03, 0x04};
byte[] checksum = Crc32(inputData);
PrintLine($"CRC-32 Checksum: {ByteArrayToString(checksum)}");

Function: Crc16

byte[] Crc16(byte[] data)

Description:
Calculates the CRC-16 checksum for the provided data.

Parameters:
- data: The byte array for which the CRC-16 checksum should be calculated.

Return Value:
Returns a byte array containing the CRC-16 checksum.

Usage Example
1
2
3
byte[] inputData = {0x01, 0x02, 0x03, 0x04};
byte[] checksum = Crc16(inputData);
PrintLine($"CRC-16 Checksum: {ByteArrayToString(checksum)}");

Function: Crc16T

byte[] Crc16T(byte[] data)

Description:
Calculates a variant of the CRC-16 checksum, possibly with a different polynomial or algorithm, for the provided data.

Parameters:
- data: The byte array for which the CRC-16T checksum should be calculated.

Return Value:
Returns a byte array containing the CRC-16T checksum.

Usage Example
1
2
3
byte[] inputData = {0x01, 0x02, 0x03, 0x04};
byte[] checksum = Crc16T(inputData);
PrintLine($"CRC-16T Checksum: {ByteArrayToString(checksum)}");