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);
        }
Пример #2
0
        public void CryptoHashArrayTest()
        {
            var actual = CryptoHash.Hash(Encoding.UTF8.GetBytes("Adam Caudill"));

            CollectionAssert.AreEqual(Utilities.HexToBinary(SHA512_HASH), actual);
        }
Пример #3
0
        public void CryptoHashStringTest()
        {
            var actual = CryptoHash.Hash("Adam Caudill");

            CollectionAssert.AreEqual(Utilities.HexToBinary(SHA512_HASH), actual);
        }