public class ChaosRNG extends java.lang.Object implements RandomnessSource
Constructor and Description |
---|
ChaosRNG()
Builds a ChaosRNG with a fairly-random seed derived from somewhat-OK sources of non-seed randomness, such as time
before and after garbage collection.
|
Modifier and Type | Method and Description |
---|---|
ChaosRNG |
copy()
Produces another ChaosRNG with no relation to this one; this breaks the normal rules that RandomnessSource.copy
abides by because this class should never have its generated number sequence be predictable.
|
int |
next(int bits)
Using this method, any algorithm that might use the built-in Java Random
can interface with this randomness source.
|
long |
nextLong()
Can return any long, positive or negative, of any size permissible in a 64-bit signed integer.
|
void |
randomize()
Changes the internal state to a new, fully-random version that should have no relation to the previous state.
|
java.lang.String |
toString() |
public ChaosRNG()
public final int next(int bits)
RandomnessSource
next
in interface RandomnessSource
bits
- the number of bits to be returnedpublic final long nextLong()
nextLong
in interface RandomnessSource
public ChaosRNG copy()
copy
in interface RandomnessSource
public void randomize()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © Eben Howard 2012–2022. All rights reserved.