public static String generateSalt ( int saltLength ) { StringBuilder salt = new StringBuilder ( saltLength ) ; for ( int i = 0 ; i < saltLength ; i ++ ) { salt . append ( CHAR_ARRAY [ random . nextInt ( CHAR_ARRAY . length ) ] ) ; } return salt . toString ( ) ; }
md5 128bit 16bytes sha1 160bit 20bytes sha256 256bit 32bytes sha384 384bit 48bytes sha512 512bit 64bytes