public void ComputeHashFromBytes() { var expected = Utilities.HexToBinary("8866267f985204ae511980704ac85ec4936ee535c37541f342976b2cb3ac62fd"); var hashStream = new GenericHash.GenericHashAlgorithm("This is a test key", 32); var actual = hashStream.ComputeHash(Encoding.UTF8.GetBytes("Adam Caudill")); CollectionAssert.AreEqual(expected, actual); }
public void ComputeHashFromNullStream() { var expected = Utilities.HexToBinary("4afd15412c1b940d7cffc9049b9ed413cbaeb626aca2a70c2afbeea7a85bdf8e"); var stream = Stream.Null; var hashStream = new GenericHash.GenericHashAlgorithm("This is a test key", 32); var actual = hashStream.ComputeHash(stream); CollectionAssert.AreEqual(expected, actual); }