title: how many unique ids can be generated
body: <p>i am using the below code to create a unique Id which is 8 character (including numeric and alphanumeric characters). </p>
  
  <pre><code>try {
              List&lt;String&gt; uuidList = new ArrayList&lt;String&gt;();
              int counter = 1;
              File file = new File("D://temp//temp1.txt");
              file.createNewFile();
  
              Writer writer = new FileWriter(file);
              BufferedWriter wr = new  BufferedWriter(writer);
              while(true) {
                  int length = bitsArray.length;
                  Random r = new Random();
                  StringBuffer uuid = new StringBuffer();
                  for(int i= 0; i &lt; 8; i++) {
                      int nextRandomId = r.nextInt(length);
                      uuid.append(bitsArray[nextRandomId]);
                  }
                  String uuidString = uuid.toString();
                  wr.write(uuidString);
                  wr.newLine();
                  if(counter != 1 &amp;&amp; uuidList.contains(uuidString)) {
                      Thread.sleep(1000);
                      System.err.println(counter);
                      break;
                  }
                  //061e735145fc
                  System.err.println(uuidString);
                  uuidList.add(uuidString);
                  counter++;
              }
          } catch (Exception e) {
  
          }
  </code></pre>
  
  <p>i need to know, if i use the above code.. then how many unique ids i can generate. Given</p>
  
  <pre><code>static String[] bitsArray = {"a","b","c","d","e","f","g","h","i",
                            "j","k","l","m","n","o","p","q","r",
                            "s","t","u","v","w","x","y","z",
                            "0","1","2","3","4","5","6","7","8","9"};
  </code></pre>
  
  <p>Please help..</p>