spring security - How to generate SALT value in Java? -


what's best way produce salt value in java string that's @ least 32 bytes long?

final random r = new securerandom(); byte[] salt = new byte[32]; r.nextbytes(salt); /** string encodedsalt = base64.encodebase64string(salt); */ 

Comments