public void HashTest() { var hash = CryptoHash.Hash(System.Text.Encoding.UTF8.GetBytes(hashString)); string hex = BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); Assert.AreEqual(sha512out, hex); hash = CryptoHash.Hash(hashString); hex = BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); Assert.AreEqual(sha512out, hex); }
public void CryptoHashArrayTest() { var actual = CryptoHash.Hash(Encoding.UTF8.GetBytes("Adam Caudill")); CollectionAssert.AreEqual(Utilities.HexToBinary(SHA512_HASH), actual); }
public void CryptoHashStringTest() { var actual = CryptoHash.Hash("Adam Caudill"); CollectionAssert.AreEqual(Utilities.HexToBinary(SHA512_HASH), actual); }