I have some data that passed over a RS232 connection, with a checksum at the end. I would like to know what the checksum function is. I've tried multiple variants of crc8 as well as simple XOR or addition, to no avail.
How can I identify the checksum function ?
Here is some data and checksums:
b'\x0f\xc8\x1c|\x00\x00d\xa2\x00\x00\x00\x00\x00\x00' -> 0x8a
b'\x0f\xc8?|\x00\x006\xa2\x00\x00\x00\x00\x00\x00' -> 0x95
b'\x0f\xc9\xc4^\x00\x00om\x00\x00\x00\x00\x00\x00' -> 0x29
Now with the update to the question with a corrected check value, it appears that they are 0xff
minus the low eight bits of the sum of the message bytes.
This was found by simply adding the message bytes and the check value and seeing that in each case, the low eight bits were 0xff
. In fact, that is the easiest way to check the check value.