Class NonBlockingPRNG
- java.lang.Object
-
- io.heraldprox.herald.sensor.datatype.random.RandomSource
-
- io.heraldprox.herald.sensor.datatype.random.NonBlockingPRNG
-
public class NonBlockingPRNG extends RandomSource
Non-blocking pseudo random number generator (PRNG) based on Random. Uses a new seed for every call and incorporates entropy from elapsed time since last call, and also optional external entropy. Use this when call time is inherently unpredictable due to external influences.
-
-
Field Summary
-
Fields inherited from class io.heraldprox.herald.sensor.datatype.random.RandomSource
entropy
-
-
Constructor Summary
Constructors Constructor Description NonBlockingPRNG()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
nextBytes(byte[] bytes)
Get random bytes from the random source.-
Methods inherited from class io.heraldprox.herald.sensor.datatype.random.RandomSource
addEntropy, addEntropy, addEntropy, hash, nextInt, nextLong, useEntropy, useEntropy
-
-
-
-
Method Detail
-
nextBytes
public void nextBytes(@NonNull byte[] bytes)
Description copied from class:RandomSource
Get random bytes from the random source.- Specified by:
nextBytes
in classRandomSource
- Parameters:
bytes
- Fill byte array with random data.
-
-