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);
        }