Package kotlin. random
Provides the default generator of pseudo-random values, the repeatable generator, and a base class for other RNG implementations.
Types
Functions
as Java Random
Link copied to clipboard
Creates a java.util.Random instance that uses the specified Kotlin Random generator as a randomness source.
Since Kotlin
1.3
as Kotlin Random
Link copied to clipboard
Creates a Kotlin Random instance that uses the specified java.util.Random generator as a randomness source.
Since Kotlin
1.3
next UBytes
Link copied to clipboard
Fills the specified unsigned byte array with random bytes and returns it.
Since Kotlin
1.3
fun Random.nextUBytes(array: UByteArray, fromIndex: Int = 0, toIndex: Int = array.size): UByteArray
Content copied to clipboard
Fills a subrange of the specified UByte
array starting from fromIndex inclusive and ending toIndex exclusive with random UBytes.
Since Kotlin
1.3