File Integrity - obtain checksum

john471

Registered User.
Local time
Tomorrow, 05:33
Joined
Sep 10, 2004
Messages
392
Hi all,

Does anyone have an easy/efficient way to compute a checksum for a text file, in order to store the file on a LAN and the checksum in a (seperate) DB ?

Presently our guys print out miles of paper evey week, and the only purpose is to send it to archive to (almost) never look at it again. These are sales logs from our mainfame system, so on the (very) rare occasions when they may need to be referenced, with the hard copy we can be sure what we are looking at is what was printed. They are only available on-line from the mainframe for about 30 days. I want to propose that we only store a soft copy, on the LAN, and archive to CD every so often for easy retrieval by our department in the unlikely event we need the data. However, I would want to have relative assurance that the file being displayed was not modified. To that end I would want to create the file, then calculate something like a checksum, and store it in my DB. Then if need arises to open the file, ensure the checksum of the file now is still the same as the checksum I stored when I created the file, and warn the reader if it may have been modified.

Anyone got any code I can borrow to save a rainforest? :D

Or at least some pointers....

Thanks

John.
 
John,
Checksums are normally generated by summing all the bytes together and ignoring overflow.

So you you add all the bytes (or words) to a variable of the correct size and that is your checksum to store in your file.
 

Users who are viewing this thread

Back
Top Bottom