Scoop API

scoop:scoop.std:0.1.0

Random

interface Random

source · line 7
public
public interface Random

A random-bit source with bounded sampling and byte helpers. Cryptographic suitability is determined by the implementation; seeded generators are not cryptographic.

function nextInt

source · line 59
public
public fun nextInt(until: Int): Int

Samples an Int; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextBytes

source · line 122
public
public fun nextBytes(array: MutableArray<Byte>, fromIndex: Long = 0L, toIndex: Long = array.size): MutableArray<Byte>

Produces a new byte array, or fills the supplied array in the half-open index range and returns it. Negative sizes and invalid ranges throw.

function nextULong

source · line 100
public
public fun nextULong(until: ULong): ULong

Samples a ULong; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextULong

source · line 32
public
public fun nextULong(): ULong

Samples a ULong; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextBits

source · line 12
public
public fun nextBits(bitCount: Int): Int

Produces 0..32 random bits in an Int result; implementations reject counts outside that range.

function nextFloat

source · line 45
public
public fun nextFloat(): Float

Samples a Float in [0, 1) using 24 random bits.

function nextInt

source · line 22
public
public fun nextInt(): Int

Samples an Int; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextUInt

source · line 73
public
public fun nextUInt(until: UInt): UInt

Samples a UInt; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextLong

source · line 41
public
public fun nextLong(): Long

Samples a Long; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextLong

source · line 86
public
public fun nextLong(until: Long): Long

Samples a Long; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.

function nextDouble

source · line 49
public
public fun nextDouble(): Double

Samples a Double in [0, 1) using 53 random bits.

function nextBytes

source · line 114
public
public fun nextBytes(size: Long): Array<Byte>

Produces a new byte array, or fills the supplied array in the half-open index range and returns it. Negative sizes and invalid ranges throw.

function nextUInt

source · line 27
public
public fun nextUInt(): UInt

Samples a UInt; bounded overloads use a lower-inclusive, upper-exclusive nonempty range, with zero as the default lower bound.