Hash File Stream?

  • Thread starter Thread starter Sebastian Dau
  • Start date Start date
S

Sebastian Dau

Hello,

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).

Does anybody know a good pattern of how to create a stream from a binary
file
and compute the hash of it?


I appriciate your comments.
Thanks in advance, Sebastain Dau.
 
FileStream fs = new FileStream(...);

HashAlgorithm ha = (HashAlgorithm) CryptoConfig.CreateFromName("MD5");
byte[] Hash = ha.ComputerHash(fs);
 
Back
Top