Add no-args Random constructor
@@ -120,6 +120,25 @@ public class Random {
private final Xorshiro128 rnd;
+ //8020463840 is from "Case File n_221: Kabukicho"
+ private static volatile long seedHalf = 8020463840L;
+
+ public static long newSeed() {
+ // 3512401965023503517 is from L'Ecuyer, "Tables of Linear Congruential Generators of
+ // Different Sizes and Good Lattice Structure", 1999
+ long seedHalfLocal = Random.seedHalf;
+ seedHalfLocal *= 3512401965023503517L;
+ Random.seedHalf = seedHalfLocal;
+ return seedHalfLocal;
+ }
+
+ /**
+ * Create a new instance of {@link Random} and initialize it with the given <code>seed</code>.
+ */
+ public Random() {
+ this(newSeed() ^ System.nanoTime());
+ }
+
/**
* Create a new instance of {@link Random} and initialize it with the given <code>seed</code>.
*
