A component add MD5 signature at files uploaded

A component add MD5 signature at files uploaded

am 03.01.2008 09:02:31 von luigi.corrias

Someone can tell me if it exist for asp.net, where i can find etc?..

Thanks and happy new year

Luigi

Re: A component add MD5 signature at files uploaded

am 03.01.2008 18:14:13 von peter.bucher

Hello Luigi

These is build in at the .NET Framework.
System.Security.Cryptography

for example (not tested):

private string GetFileHash(byte[] file) {
MD5 hasher = MD5.Create();
byte[] data = hasher.ComputeHash(file);
StringBuilder sb = new StringBuilder();

foreach (byte d in data)
sb.Append(d.ToString("x2"));

return sb.ToString();
}

see: http://www.google.ch/search?hl=de&q=get+hash+from+file+.net& meta=

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Re: A component add MD5 signature at files uploaded

am 04.01.2008 14:25:47 von luigi.corrias

Thanks Peter

But i don't understand

The MD% signatire of the file is the same i can find using an utility
like fsum

Thank again and happy New year

L.