get sha1 hash of file c# code example
Example 1: get sha1 of file c#
FileStream fop = File.OpenRead(@"C:\test.bin");
string hash = BitConverter.ToString(System.Security.Cryptography.SHA1.Create().ComputeHash(fop));
Example 2: get sha1 of file c#
using(var cryptoProvider = new SHA1CryptoServiceProvider())
{
string hash = BitConverter
.ToString(cryptoProvider.ComputeHash(buffer));
}