question: public static String gensalt ( final int log_rounds , final SecureRandom random ) { final StringBuffer rs = new StringBuffer ( ) ; final byte rnd [ ] = new byte [ BCRYPT_SALT_LEN ] ; random . nextBytes ( rnd ) ; rs . append ( "$2a$" ) ; if ( log_rounds < 10 ) { rs . append ( "0" ) ; } if ( log_rounds > 30 ) { throw new IllegalArgumentException ( "log_rounds exceeds maximum (30)" ) ; } rs . append ( Integer . toString ( log_rounds ) ) ; rs . append ( "$" ) ; rs . append ( encode_base64 ( rnd , rnd . length ) ) ; return rs . toString ( ) ; }
target:  Generate a salt for use with the BCrypt.hashpw() method