using(var cryptoProvider = new SHA1CryptoServiceProvider()) { string hash = BitConverter .ToString(cryptoProvider.ComputeHash(buffer)); }