List of usage examples for org.springframework.security.crypto.bcrypt BCrypt gensalt
public static String gensalt(String prefix, int log_rounds, SecureRandom random) throws IllegalArgumentException
From source file:org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder.java
public String encode(CharSequence rawPassword) { String salt;//from w w w. ja va2s . c o m if (strength > 0) { if (random != null) { salt = BCrypt.gensalt(version.getVersion(), strength, random); } else { salt = BCrypt.gensalt(version.getVersion(), strength); } } else { salt = BCrypt.gensalt(version.getVersion()); } return BCrypt.hashpw(rawPassword.toString(), salt); }