public class PRNG extends Object implements VertxContextPRNG
Modifier and Type | Method and Description |
---|---|
void |
close()
stop seeding the PRNG
|
boolean |
nextBoolean()
Returns a secure random boolean
|
void |
nextBytes(byte[] bytes)
Fills the given byte array with random bytes.
|
double |
nextDouble()
Returns a secure random double value.
|
float |
nextFloat()
Returns a secure random float value.
|
double |
nextGaussian()
Returns a secure random double value.
|
int |
nextInt()
Returns a secure random int
|
int |
nextInt(int bound)
Returns a secure random int, between 0 (inclusive) and the specified bound (exclusive).
|
long |
nextLong()
Returns a secure random long
|
String |
nextString(int length)
Returns a Base64 url encoded String of random data with the given length.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
current, current, current
public PRNG(Vertx vertx)
public void close()
VertxContextPRNG
close
in interface VertxContextPRNG
public void nextBytes(byte[] bytes)
VertxContextPRNG
nextBytes
in interface VertxContextPRNG
bytes
- a byte array.public int nextInt()
VertxContextPRNG
nextInt
in interface VertxContextPRNG
public int nextInt(int bound)
VertxContextPRNG
nextInt
in interface VertxContextPRNG
bound
- the upper bound (exclusive), which must be positive.public boolean nextBoolean()
VertxContextPRNG
nextBoolean
in interface VertxContextPRNG
public long nextLong()
VertxContextPRNG
nextLong
in interface VertxContextPRNG
public float nextFloat()
VertxContextPRNG
nextFloat
in interface VertxContextPRNG
public double nextDouble()
VertxContextPRNG
nextDouble
in interface VertxContextPRNG
public double nextGaussian()
VertxContextPRNG
nextGaussian
in interface VertxContextPRNG
public String nextString(int length)
VertxContextPRNG
nextString
in interface VertxContextPRNG
length
- the desired string length before Base64 encoding.Copyright © 2024 Eclipse. All rights reserved.