This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is There A Check16 Utility?

Does anyone have a check16 utility for doing a 16 bit checksum? If not, does anyone have source for Check8?
Thanks,

  • It's just a matter of summing all the data values - nothing difficult!

  • There are a number of slightly different addition-based 16-bit checksums. The simplest is just to add all 16-bit words, but there are others.

    For example, the IP header checksum is the one's complement of the one's complement sum of all 16-bit words. That is, rather than add them all up, you have to add a pair, then add the carry from that addition. Then invert the final result.

    Then, there's a 16-bit Fletcher's checksum that's an option in TCP. See RFC 1146.

    Can the OP be more specific as to what algorithm you're looking for?

    One of the CRC-16s is about as easy to calculate in practice and provides much stronger protection.

  • Yes - but I was hoping that I could get the source for Check8 or if Kiel folks could quickly turn out a Check16 rather then spend time writing my own version.

  • I was initially thinking I'd just add up 16 bit words for a stronger version of an 8 bit checksum. Using a similar utility to check8 (like Check16 maybe) write the checksum at the top of the 64 flash and at boot time have the 8051 verify it. I was hoping that if someone already had a something to do this then I wouldn't have to spend the time writing it.

  • This is outright silly

    or if Kiel folks could quickly turn out a Check16 rather then spend time writing my own version.
    1) you have now waited 5 1/2 hours for something it would take you 5 minutes to write.
    2) 99% of checksumming is done "on the fly" and thus do not have a "check16 utility".

    Erik

  • Ok ... I give up.. I've started writing it myself anyway... I was just hoping that Keil had source available for Check8 or something already. Thanks anyway.