in commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/SeedFactory.java [316:335]
static void ensureNonZero(long[] seed, int from, int to) {
if (from >= to) {
return;
}
// No check on the range so an IndexOutOfBoundsException will occur if invalid
for (int i = from; i < to; i++) {
if (seed[i] != 0) {
return;
}
}
// Fill with non-zero values using a SplitMix-style PRNG.
// The range is at least 1.
// To ensure the first value is not zero requires the input to the mix function
// to be non-zero. This is ensured if the start is even since the increment is odd.
long x = createLong() << 1;
for (int i = from; i < to; i++) {
x += MixFunctions.GOLDEN_RATIO_64;
seed[i] = MixFunctions.stafford13(x);
}
}