Wayne <Me******@community.nospam> wrote:
I want to take a checksum of a file, and store it. I use the checksum list
to compare to the current file I'm checking, if it's checksum is in the list
I delete the file.
Is there anything built in to .net that will give me back a checksum of a
file?
if so will it be unique enough to trust for the above?
if nothing built in, anything someone can suggest that is freely avail on
the web?
Robert mentioned SHA1 and MD5. These are both likely to be slower than
a "simple" checksum, but more secure. If you're trying to avoid
tampering, a cryptographic hash like SHA1 or MD5 is a good idea. If
you're only trying to avoid accidental corruptiong, a checksum should
be fine.
I have a simple implementation of Adler32 in my "MiscUtil" library
available at
http://www.pobox.com/~skeet/csharp/miscutil
Feel free to use it in your own project.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too