Пример #1
0
 /**
  * Returns the SecureRandom used to generate secure random data.
  *
  * <p>Creates and initializes if null. Uses {@code System.currentTimeMillis() +
  * System.identityHashCode(this)} as the default seed.
  *
  * @return the SecureRandom used to generate secure random data, wrapped in a {@link
  *     RandomGenerator}.
  */
 private RandomGenerator getSecRan() {
   if (secRand == null) {
     secRand = RandomGeneratorFactory.createRandomGenerator(new SecureRandom());
     secRand.setSeed(System.currentTimeMillis() + System.identityHashCode(this));
   }
   return secRand;
 }
Пример #2
0
 /**
  * Sets the default generator to a {@link Well19937c} generator seeded with {@code
  * System.currentTimeMillis() + System.identityHashCode(this))}.
  */
 private void initRan() {
   rand = new Well19937c(System.currentTimeMillis() + System.identityHashCode(this));
 }
Пример #3
0
 /**
  * Reseeds the random number generator with {@code System.currentTimeMillis() +
  * System.identityHashCode(this))}.
  */
 public void reSeed() {
   getRandomGenerator().setSeed(System.currentTimeMillis() + System.identityHashCode(this));
 }