Example #1
0
        public void TestHashValidity()
        {
            var strToHash = "My hash text";
            var hashed    = BCryptCipher.Hash(strToHash);

            Assert.IsTrue(BCryptCipher.Equals(strToHash, hashed));
        }
Example #2
0
        public void TestHashFromAnotherPlatform()
        {
            var unhashed = "test from another platform";
            var hashed   = "$2a$10$1VCl1KwOpTscBMM0MfgEdugbvMbwr5/ekb1t6lqO55mhhlYteqqD2";

            Assert.IsTrue(BCryptCipher.Equals(unhashed, hashed));
        }
Example #3
0
        public void TestInvalidHash()
        {
            var hashed = BCryptCipher.Hash("test");

            Assert.IsFalse(BCryptCipher.Equals("testing", hashed));
        }