algorithm - Checksum for short data on microcontroller? -


i'm looking checksum short binary data messages (3-5 bytes typical) on microcontroller. detects kinds of errors can happen on spi bus, example off-by-ones , repeats ("abc" -> "bcd", , "abc"->"aab"). should catch edge cases of all-zeros, all-ones , all-same-value. checksum can add 2-4 bytes.

running speed not critical not process data; code size important.

see http://pubs.opengroup.org/onlinepubs/009695299/utilities/cksum.html algorithm used cksum, based on 1 used within ethernet standard. use within ethernet catch errors similar ones face.

that algorithm give 4 byte checksum size of data wish.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -