예제 #1
0
        public void Sha512ComputeShouldReturnValidNumberOfCharacters(int hashLength)
        {
            var sut  = new Base62HasherSha512(hashLength);
            var hash = sut.Compute(CLEAR_TEXT);

            Assert.StrictEqual(hashLength, hash.Length);
        }
예제 #2
0
        public void Sha512ComputeShouldReturnValidCharacters(string clearText)
        {
            var sut  = new Base62HasherSha512(5);
            var hash = sut.Compute(clearText);

            bool flag       = true;
            var  enumerator = hash.GetEnumerator();

            while (flag && enumerator.MoveNext())
            {
                flag = SYMBOLS.Contains(enumerator.Current.ToString());
            }

            Assert.True(flag);
        }