@Test void testHashDifferent() { String plaintext = "password"; String secondPlaintext = "secondPassword"; String result = hashService.hash(plaintext); String secondResult = hashService.hash(secondPlaintext); assertTrue(hashService.isMatch(plaintext, result)); assertTrue(hashService.isMatch(secondPlaintext, secondResult)); assertFalse(hashService.isMatch(plaintext, secondResult)); assertFalse(hashService.isMatch(secondPlaintext, result)); }
@Override public String hash(String plaintext) { if (serverSideHashEnabled()) { return BCrypt.withDefaults().hashToString(10, plaintext.toCharArray()); } return plaintext; }
BCryptHashService extends HashService { @Override public String hash(String plaintext) { if (serverSideHashEnabled()) { return BCrypt.withDefaults().hashToString(10, plaintext.toCharArray()); } return plaintext; } }
BCryptHashService extends HashService { @Override public String hash(String plaintext) { if (serverSideHashEnabled()) { return BCrypt.withDefaults().hashToString(10, plaintext.toCharArray()); } return plaintext; } BCryptHashService(boolean serverSideHashEnabled, boolean allowCommonMistakes); }
BCryptHashService extends HashService { @Override public String hash(String plaintext) { if (serverSideHashEnabled()) { return BCrypt.withDefaults().hashToString(10, plaintext.toCharArray()); } return plaintext; } BCryptHashService(boolean serverSideHashEnabled, boolean allowCommonMistakes); @Override String hash(String plaintext); }
BCryptHashService extends HashService { @Override public String hash(String plaintext) { if (serverSideHashEnabled()) { return BCrypt.withDefaults().hashToString(10, plaintext.toCharArray()); } return plaintext; } BCryptHashService(boolean serverSideHashEnabled, boolean allowCommonMistakes); @Override String hash(String plaintext);  }