title: Java: RandomStringUtils Random seed
body: <p>I've been using <code>RandomStringUtils</code> to generate random IDs to be used as database keys:</p>
  
  <pre class="lang-java prettyprint-override"><code>import org.apache.commons.lang.RandomStringUtils;
  public class RandomStringTest {
      public static void main(final String[] args) {
          for (int i = 0; i &lt;= 10; i++) {
              final String id = RandomStringUtils.random(8,
                      "0123456789abcdefghijklmnopqrstuvwxyz");
              System.out.println(id);
          }
      }
  }
  </code></pre>
  
  <p>The key space is large enough,</p>
  
  <pre><code>len("0123456789abcdefghijklmnopqrstuvwxyz")^8 = 2821109907456 ≃ 10^12
  </code></pre>
  
  <p><strong>Is the random mechanism properly seeded?</strong> I need to know that the keys are properly distributed before applying this to production.</p>
  
  <p>By the way, the test code showed no repetitions when executed a few times, but that's far from solid proof.</p>