Example #1
0
        public void ValidateSha256(string input, ShaProvider.Algorithm algorithm, string expectedHash)
        {
            ShaProvider sha          = new ShaProvider(algorithm);
            string      computedHash = sha.ComputeHash(input.GetBytes()).ToHex();

            Assert.Equal(expectedHash, computedHash, true);
        }
Example #2
0
        public void ValidateSha256_Default()
        {
            byte[]       input        = "".GetBytes();
            const string expectedHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";

            ShaProvider sha          = new ShaProvider();
            string      computedHash = sha.ComputeHash(input).ToHex();

            Assert.Equal(expectedHash, computedHash, true);
        }