public static String randomString ( final int size ) { final StringBuilder builder = new StringBuilder ( ) ; while ( builder . length ( ) < size ) { final String suffix = java . util . UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ; builder . append ( suffix ) ; } return builder . substring ( 0 , size ) ; }
Return a random string of a certain size .