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