open class 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 the io.vertx.ext.auth.VertxContextPRNG non RX-ified interface using Vert.x codegen.
VertxContextPRNG(delegate: VertxContextPRNG) |
static val __TYPE_ARG: TypeArg<VertxContextPRNG> |
open static fun current(): VertxContextPRNG
Get or create a secure non blocking random number generator using the current vert.x context. If there is no current context (i.e.: not running on the eventloop) then a java.lang.IllegalStateException is thrown. open static fun current(vertx: Vertx): VertxContextPRNG
Get or create a secure non blocking random number generator using the current vert.x instance. Since the context might be different this method will attempt to use the current context first if available and then fall back to create a new instance of the PRNG. |
|
open fun equals(other: Any?): Boolean |
|
open fun getDelegate(): VertxContextPRNG |
|
open fun hashCode(): Int |
|
open static fun newInstance(arg: VertxContextPRNG): VertxContextPRNG |
|
open fun nextInt(): Int
Returns a secure random int |
|
open fun nextString(length: Int): String
Returns a Base64 mime encoded String of random data with the given length. The length parameter refers to the length of the String before the encoding step. |
|
open fun toString(): String |