Re: Am I doing this right. Hashing a text file
From: Henning Krause (newsgroup.no_at_spam.infinitec.de)
Date: 05/28/04
- Previous message: Anders Jansson: "RE: Am I doing this right. Hashing a text file"
- In reply to: Anders Jansson: "Am I doing this right. Hashing a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 28 May 2004 22:19:02 +0200
Hello,
I think your code is right... use this method myself.
Greetings,
Henning Krause
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/?page=products)
"Anders Jansson" <anders.jansson@araelektroniks.se> wrote in message
news:39C1BF44-2FBD-4283-A559-C87C87EAABF4@microsoft.com...
> Hi!
>
> Just wanted a confirmation about hashing an entire file correctly.
> Does this code really read all bytes from the file while calculating the
hash value?
>
> --Code MC++ start
>
> Byte [] HashFile(String fileName)
> {
> if (File::Exists(fileName))
> {
> System::IO::FileStream * file = File::OpenRead(fileName);
>
> // This is one implementation of the abstract class MD5.
> MD5 md5 = new MD5CryptoServiceProvider();
>
> return = md5.ComputeHash(file);
> }
> }
> --Code MC++ end
>
> /Thanks
- Previous message: Anders Jansson: "RE: Am I doing this right. Hashing a text file"
- In reply to: Anders Jansson: "Am I doing this right. Hashing a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|