@Test public void testDigestResultChange() { BCryptPasswordEncoder digester = PasswordUtils.getBcryptDigestByLevel(0); String result1 = digester.encode(STRING); String result2 = digester.encode(STRING); assertTrue("Digest two times should produce different result", result1 != result2); }
public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); } }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  static String createPassword(String rawPass, String salt); static boolean isPasswordValid(String encPass, String rawPass, String salt); static String updateOldEncPass(String oldPW, String salt); static BCryptPasswordEncoder getBcryptDigestByLevel(int level); static String addSalt(String origin, String salt); }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  static String createPassword(String rawPass, String salt); static boolean isPasswordValid(String encPass, String rawPass, String salt); static String updateOldEncPass(String oldPW, String salt); static BCryptPasswordEncoder getBcryptDigestByLevel(int level); static String addSalt(String origin, String salt); static final PasswordEncoder encoder; static final BCryptPasswordEncoder digester; }