public static String urlSafeString(final int numBits){
  SecureRandom ng=Holder.numberGenerator;
  StringBuilder sb=new StringBuilder(1 + (numBits / 6));
  for (int i=numBits; i > 0; i-=6) {
    sb.append(base64URL[ng.nextInt(i > 6 ? 64 : (1 << i))]);
  }
  return sb.toString();
}

public static String urlSafeString ( final int numBits ) { SecureRandom ng = Holder . numberGenerator ; StringBuilder sb = new StringBuilder ( 1 + ( numBits / 6 ) ) ; for ( int i = numBits ; i > 0 ; i -= 6 ) { sb . append ( base64URL [ ng . nextInt ( i > 6 ? 64 : ( 1 << i ) ) ] ) ; } return sb . toString ( ) ; }
generate a string using base64 url safe characters with numbits bits . < p / > this method uses securerandom , same as uuid . an 128 bit id generated with this function will be as unique as an uuid
