Hi Sebastian!
>>I'm writing a security related application in .NET 1.1
>>and I wonder how I compute hashes from very large files (up to 1 GB).
[quoted text clipped - 5 lines]
> String* sHashVal = UTF8Encoding->GetString ( hash->ComputeHash (
> File::OpenRead ( "c:\test.txt" ) ));
I dodnßt know if this is a good idea for large files ( > 1GB)...
For this you need to read small pieces of the file and incremently
create the hash...

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Sebastian Dau - 09 Jun 2005 08:33 GMT
>> SHA256Managed* hash = new SHA256Managed ();
>> String* sHashVal = UTF8Encoding->GetString ( hash->ComputeHash (
[quoted text clipped - 3 lines]
> For this you need to read small pieces of the file and incremently create
> the hash...
Right, that's exactly what it's doing...
ComputeHash takes a stream object and internally hashes block by block
File::OpenRead returns such a Stream inherited object.
Greetings, Sebastian
Jochen Kalmbach [MVP] - 09 Jun 2005 09:02 GMT
Hi Sebastian!
>>>SHA256Managed* hash = new SHA256Managed ();
>>>String* sHashVal = UTF8Encoding->GetString ( hash->ComputeHash (
[quoted text clipped - 5 lines]
>
> Right, that's exactly what it's doing...
Upps... yes, you are right... sorry for the confusion...

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/