RandomExtension extension

on

Methods

asJavaRandom() Random

Available on Random, provided by the RandomExtension extension

Creates a java.util.Random instance that uses the specified Kotlin Random generator as a randomness source.
asKotlinRandom() Random

Available on Random, provided by the RandomExtension extension

Creates a Kotlin Random instance that uses the specified java.util.Random generator as a randomness source.
nextBits(Int bitCount) Int

Available on Random, provided by the RandomExtension extension

Gets the next random bitCount number of bits.
nextBoolean() Boolean

Available on Random, provided by the RandomExtension extension

Gets the next random Boolean value.
nextBytes(ByteArray array, {Int fromIndex = 0, Int toIndex = DEFAULT_BUFFER_SIZE}) ByteArray

Available on Random, provided by the RandomExtension extension

Fills a subrange of the specified byte array starting from fromIndex inclusive and ending toIndex exclusive with random bytes.
nextDouble({Double from = 0, Double until = 1}) Double

Available on Random, provided by the RandomExtension extension

Gets the next random Double from the random number generator in the specified range.
nextFloat() Float

Available on Random, provided by the RandomExtension extension

Gets the next random Float value uniformly distributed between 0 (inclusive) and 1 (exclusive).
nextInt({Int from = -DEFAULT_BUFFER_SIZE, Int until = DEFAULT_BUFFER_SIZE}) Int

Available on Random, provided by the RandomExtension extension

Gets the next random Int from the random number generator in the specified range.
nextLong({Long from = -DEFAULT_BUFFER_SIZE, Long until = DEFAULT_BUFFER_SIZE}) Int

Available on Random, provided by the RandomExtension extension

Gets the next random Long from the random number generator in the specified range.
nextUBytes(ByteArray array, {Int fromIndex = 0, Int toIndex = DEFAULT_BUFFER_SIZE}) UByteArray

Available on Random, provided by the RandomExtension extension

Gets the next random UByte from the random number generator.
nextUInt({UInt from = -DEFAULT_BUFFER_SIZE, UInt until = DEFAULT_BUFFER_SIZE}) UInt

Available on Random, provided by the RandomExtension extension

Gets the next random UInt from the random number generator in the specified range.
nextULong({ULong from = -DEFAULT_BUFFER_SIZE, ULong until = DEFAULT_BUFFER_SIZE}) ULong

Available on Random, provided by the RandomExtension extension

Gets the next random ULong from the random number generator in the specified range.