List of usage examples for org.apache.shiro.crypto RandomNumberGenerator nextBytes
ByteSource nextBytes(int numBytes);
From source file:com.bridge.utils.SecurityUtils.java
public static String[] digest(String password) { RandomNumberGenerator generator = new SecureRandomNumberGenerator(); String salt = generator.nextBytes(32).toBase64(); password = new Sha256Hash(password, salt, 1024).toBase64(); return new String[] { password, salt }; }