Skip to content

Suiteopensavvy.prepared.suite.randomRandom

Random

class Random

Random control helper. See random.

Functions

accessUnsafe

suspend fun accessUnsafe(): Random

Gives uncontrolled access to the underlying Random.

nextBits

suspend fun Random.nextBits(bitCount: Int): Int

Generates random bits.

nextBoolean

suspend fun Random.nextBoolean(): Boolean

Generates a random boolean.

nextDouble

suspend fun Random.nextDouble(): Double

Generates a random double.

suspend fun Random.nextDouble(from: Double, until: Double): Double

Generates a random double.

nextFloat

suspend fun Random.nextFloat(): Float

Generates a random float.

nextInt

suspend fun Random.nextInt(): Int

Generates a random integer.

suspend fun Random.nextInt(from: Int, until: Int): Int

Generates a random integer.

nextLong

suspend fun Random.nextLong(): Long

Generates a random integer.

suspend fun Random.nextLong(from: Long, until: Long): Long

Generates a random integer.

setSeed

suspend fun setSeed(seed: Long)

Initializes the underlying Random implementation with seed.

use

suspend fun <T> use(block: (Random) -> T): T

Provides block with the underlying Random source.