473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

CRC Files

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?

Thanks
Wayne Sepega
Jacksonville, Fl
Nov 16 '05 #1
3 3583
Hi Wayne,
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?
MD5CryptoServiceProvider
SHA1CryptoServiceProvider

both in the System.Security.Cryptography namespace
if so will it be unique enough to trust for the above?


Yes ;-)

bye
Rob
Nov 16 '05 #2
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
Nov 16 '05 #3
This should do what I need.

--
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Robert Jordan" <ro*****@gmx.net> wrote in message
news:ci*************@news.t-online.com...
Hi Wayne,
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?


MD5CryptoServiceProvider
SHA1CryptoServiceProvider

both in the System.Security.Cryptography namespace
if so will it be unique enough to trust for the above?


Yes ;-)

bye
Rob

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
0
by: wal | last post by:
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
2
by: Chocolade | last post by:
I have a console application project wich inside im creating array of jpg files from a directory and then im formating the files and make new files and i want to reneame/move/copy the new files with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.