Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C# (http://www.programmingforums.org/forum16.html)
-   -   Sumchecks (http://www.programmingforums.org/showthread.php?t=14184)

hoffmandirt Oct 19th, 2007 8:33 AM

Sumchecks
 
I'm looking for more information about this statement:

Quote:

The Sumcheck is a conventional 16 bit sumcheck with no seeding, covering bytes 1 to n-3
I have never used sumchecks before, but I need to include one in a request via RS232. Does anyone have any code examples or links to relative information?

Thanks

DaWei Oct 19th, 2007 10:27 AM

Re: Sumchecks
 
Generally speaking, you will sum or sum-without-carry (xor) the bytes then negate or invert the sum and tack it on the end. The reason for the negation or inversion is that when you re-sum the whole thing, including the sum, the result will be zero if there are no errors.

hoffmandirt Oct 19th, 2007 12:34 PM

Re: Sumchecks
 
That sounds pretty straight forward. Thank you for the information. An error would typically mean that a byte is missing or has been tampered with correct? Also if there was seeding in this sumcheck, what would that do to the overall sum?

DaWei Oct 19th, 2007 3:02 PM

Re: Sumchecks
 
The seed would vary the checksum, so you'd need to know the seed to recover. There's a lot of literature on this for beyond-simple implementations.


All times are GMT -5. The time now is 3:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC