示例#1
0
 public static string Hash(Stream stream)
 {
     using (SHA1CryptoServiceProvider cryptoServiceProvider = new SHA1CryptoServiceProvider())
         return(HashCalculator.Sanitize(cryptoServiceProvider.ComputeHash(stream)));
 }
示例#2
0
 public static string Hash(string input)
 {
     using (SHA1CryptoServiceProvider cryptoServiceProvider = new SHA1CryptoServiceProvider())
         return(HashCalculator.Sanitize(cryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(input))));
 }