Package io.vertx.mutiny.ext.auth.prng
Class VertxContextPRNG
java.lang.Object
io.vertx.mutiny.ext.auth.prng.VertxContextPRNG
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
VertxContextPRNG
A secure non blocking random number generator isolated to the current context. The PRNG is bound to the vert.x
context and setup to close when the context shuts down.
When applicable, use of VertxContextPRNG rather than create new PRNG objects is helpful to keep the system entropy usage to the minimum avoiding potential blocking across the application.
The use of VertxContextPRNG is particularly appropriate when multiple handlers use random numbers.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVertxContextPRNG
(io.vertx.ext.auth.prng.VertxContextPRNG delegate) VertxContextPRNG
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static VertxContextPRNG
current()
static VertxContextPRNG
boolean
io.vertx.ext.auth.prng.VertxContextPRNG
int
hashCode()
static VertxContextPRNG
newInstance
(io.vertx.ext.auth.prng.VertxContextPRNG arg) boolean
void
nextBytes
(byte[] bytes) double
float
double
int
nextInt()
int
nextInt
(int bound) long
nextLong()
nextString
(int length) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
VertxContextPRNG
public VertxContextPRNG(io.vertx.ext.auth.prng.VertxContextPRNG delegate) -
VertxContextPRNG
-
-
Method Details
-
getDelegate
public io.vertx.ext.auth.prng.VertxContextPRNG getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
current
- Returns:
- A secure non blocking random number generator.
-
current
- Parameters:
vertx
- a Vert.x instance.- Returns:
- A secure non blocking random number generator.
-
close
public void close() -
nextString
- Parameters:
length
- the desired string length before Base64 encoding.- Returns:
- A base 64 encoded string.
-
nextInt
public int nextInt()- Returns:
- random int.
-
nextInt
public int nextInt(int bound) - Parameters:
bound
- the upper bound (exclusive), which must be positive.- Returns:
- random int.
-
nextBoolean
public boolean nextBoolean()- Returns:
- random boolean.
-
nextLong
public long nextLong()- Returns:
- random long.
-
nextFloat
public float nextFloat()- Returns:
- random float.
-
nextDouble
public double nextDouble()- Returns:
- random double.
-
nextGaussian
public double nextGaussian()- Returns:
- random double.
-
nextBytes
public void nextBytes(byte[] bytes) - Parameters:
bytes
- a byte array.
-
newInstance
-