예제 #1
0
파일: Program.cs 프로젝트: dkblock/Blake2B
        private static byte[] GetHash(string testString)
        {
            var blake     = new Blake2B_Algorithm();
            var testValue = Encoding.ASCII.GetBytes(testString);

            var hash          = blake.ComputeHash(testValue);
            var hashToDisplay = blake.ComputeHash(testString);

            Console.WriteLine(hashToDisplay);
            Console.ReadLine();

            return(hash);
        }
예제 #2
0
        public HashTests()
        {
            var blake      = new Blake2B_Algorithm();
            var testString = "The quick brown fox jumps over the lazy dog";
            var testData   = Encoding.ASCII.GetBytes(testString);
            var hash       = blake.ComputeHash(testData);

            _testValue = new BitArray(hash);
        }
예제 #3
0
        public void ComputeHash_ReturnsCorrectHash_1()
        {
            var testString = "The quick brown fox jumps over the lazy dog";

            var expected = "A8ADD4BDDDFD93E4877D2746E62817B116364A1FA7BC148D95090BC7333B3673F82401CF7AA2E4CB1ECD90296E3F14CB5413F8ED77BE73045B13914CDCD6A918";
            var actual   = _blake.ComputeHash(testString);

            Assert.True(AreEqual(expected, actual));
        }