public void TestHashValidity() { var strToHash = "My hash text"; var hashed = BCryptCipher.Hash(strToHash); Assert.IsTrue(BCryptCipher.Equals(strToHash, hashed)); }
public void TestHashFromAnotherPlatform() { var unhashed = "test from another platform"; var hashed = "$2a$10$1VCl1KwOpTscBMM0MfgEdugbvMbwr5/ekb1t6lqO55mhhlYteqqD2"; Assert.IsTrue(BCryptCipher.Equals(unhashed, hashed)); }
public void TestInvalidHash() { var hashed = BCryptCipher.Hash("test"); Assert.IsFalse(BCryptCipher.Equals("testing", hashed)); }