|
-
October 15th, 2003, 08:43 AM
#1
How do I caclulate/use a CheckSum?
I have an app I wrote in VC++ 6.0 that outputs a binary file. Since this will be transmitted over a TCP and UDP network it has been requested that I add checksum to the file. How do I do that? I've read things here about checksums but they're all not a basic" How do I do it" type questions. Any help or info is most appreciated.
-
October 15th, 2003, 08:57 AM
#2
Very simple, you make a sum of all bytes of your data.
You don't care about overflow.
After all your data bytes, you send one more byte - a checksum byte.
The application that receives data makes the same operation. It uses the same algorithm to make a sum of all data bytes.
Then it check it against the received checksum.
If equal, no transmittion error occurs.
If not equal, request for the new transmission.
It is theoreticaly possible that two errors compensate in the cehcksum but this scenario has a very low possibility. So, this principle is not 100% sure, but it significant reduces transmittion errors.
-
October 15th, 2003, 10:16 AM
#3
I heard of something called MD5 but I haven't figured out how to implement it yet.
-
October 15th, 2003, 10:17 AM
#4
check :
http://www.boost.org
about CRC ...
-
October 20th, 2003, 08:38 AM
#5
Thanks Neo.... I ended up going with CRC rather than the MD5. Thanks for the help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|