public class ISAACRandom extends IntProvider
ISAAC (Indirection, Shift, Accumulate, Add, and Count) generates 32-bit random numbers. ISAAC has been designed to be cryptographically secure and is inspired by RC4. Cycles are guaranteed to be at least 240 values long, and they are 28295 values long on average. The results are uniformly distributed, unbiased, and unpredictable unless you know the seed.
This code is based (with minor changes and improvements) on the original implementation of the algorithm by Bob Jenkins.
| Constructor and Description |
|---|
ISAACRandom(int[] seed)
Creates a new ISAAC random number generator.
|
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
getStateInternal()
Creates a snapshot of the RNG state.
|
int |
next() |
protected void |
setStateInternal(byte[] s)
Resets the RNG to the given
state. |
nextBoolean, nextBytes, nextBytes, nextDouble, nextInt, nextLong, resetCachedStatecheckIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toStringpublic ISAACRandom(int[] seed)
seed - Initial seedprotected byte[] getStateInternal()
getStateInternal in class IntProviderprotected void setStateInternal(byte[] s)
state.setStateInternal in class IntProviders - State (previously obtained by a call to
BaseProvider.getStateInternal()).BaseProvider.checkStateSize(byte[],int)public int next()
Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.