The check sum is calulated by the value of each byte and their position therefore some simple packet like:

1234

will not have the same checksum as

4321

So what you do is to calcluate a check sum with the incoming data and see if that answer matchs the one sent in the packet.


For instance a real crappy check sum maker would be

For i = 0 to len
sum = sum + data(i) + (1024^i)
next i

Where data is an array of byte values.

HTH

G