Re: Better verification: checksum vs. xor



James Harris wrote:

I am looking for a simple way (usable on a powerful PC or a tiny
microcontroller) to verify a small amount of data of about eight
bytes.

Is it better to compare the data against a checksum or an xor of
the bytes?

I would do neither. I would compute a 16 bit CCIT crc during
transmission, and append those two bytes. The receiver can repeat
the process and compare the crcs. This is not sensitive to the
message length, but you will need to know it. The chance of an
undetected error is extremely low.

--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee, Frohe Weihnachten
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
.



Relevant Pages

  • Re: Better verification: checksum vs. xor
    ... microcontroller) to verify a small amount of data of about eight ... I would compute a 16 bit CCIT crc during ... the process and compare the crcs. ...
    (comp.programming)
  • Re: Better verification: checksum vs. xor
    ... microcontroller) to verify a small amount of data of about eight ... just send it twice and compare. ...
    (comp.programming)
  • Re: Better verification: checksum vs. xor
    ... microcontroller) to verify a small amount of data of about eight ...  I would compute a 16 bit CCIT crc during ... There is no transmission. ...
    (comp.programming)
  • Re: Better verification: checksum vs. xor
    ... microcontroller) to verify a small amount of data of about eight ... Is it better to compare the data against a checksum or an xor of the ... just send it twice and compare. ...
    (comp.programming)
  • Re: Comparing old and new state data in an object?
    ... After a certain amount of processing, ... > compare after a particular event occurs. ... The snapshot is conceptually a different problem space ... way to identify [HistorySnapshot], such as a timestamp or a sequence ...
    (comp.object)