/// <summary> /// Reads the stream and returns a Checksum calculated with the requested HashType /// </summary> /// <param name="hashType">The Algorithm used to calculate the checksum.</param> /// <returns>A lowercase string representing the checksum.</returns> public static string GenerateHash(this Stream stream, HashTypes hashType) { var hasher = hashType.GetHasher(); hasher.ComputeHash(stream); return(hasher.Hash.ToLowerString()); }
public void TestGetHasher(HashTypes hashType, Type type) { var hasher = hashType.GetHasher(); hasher.Should().BeOfType(type); }