コード例 #1
0
        public void TestSimple()
        {
            var hash = CryptographicAlgorithms.GetPasswordHash(Algorithm.SimpleHash, "12345");

            Assert.AreEqual("CA9C", hash);
        }
コード例 #2
0
 public void TestEmptyPassword()
 {
     Assert.IsEmpty(CryptographicAlgorithms.GetPasswordHash(Algorithm.SHA512, string.Empty));
     Assert.IsEmpty(CryptographicAlgorithms.GetPasswordHash(Algorithm.SimpleHash, string.Empty));
 }
コード例 #3
0
        public void TestSHA512()
        {
            var hash = CryptographicAlgorithms.GetPasswordHash(Algorithm.SHA512, "12345", "aVvPw1DNH3evPqRAd/y3UQ==", 100000);

            Assert.AreEqual("E+qAhyIg/HM0dUrPaENfimFOZp7wlOkJsf/sdG+AGHOA9grOv7VLb1ik2vuYohljI9G36e0ea9wnixCK0MMuyQ==", hash);
        }