Beispiel #1
0
        public static string Checksum(this IEnumerable <byte> value, HashType hashType)
        {
            var data = value as byte[] ?? value.ToArray();

            using (var hashAlgorithm = hashType.CreateAlgorithm())
                return(hashAlgorithm.ComputeHash(data).ToHexString());
        }
Beispiel #2
0
 public static string Checksum(this Stream stream, HashType hashType)
 {
     using (var hashAlgorithm = hashType.CreateAlgorithm())
         return(hashAlgorithm.ComputeHash(stream).ToHexString());
 }