@Test void testServerSideHashDisabled() { HashService hashService = new BCryptHashService(false, false); String plaintext = "password"; String result = hashService.hash(plaintext); assertEquals(plaintext, 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);  }