proc urandom*(size: Natural): seq[uint8] {.raises: [EOS, EOutOfMemory], inline.}
-
Returns a seq of random integers 0 <= n < 256 provided by the operating system's cryptographic source (see posix_urandom, windows_urandom)
proc random_byte*[RNG](self: var RNG): uint8
-
Returns a uniformly distributed random integer 0 <= n < 256
proc random_int*[RNG](self: var RNG; max: Positive): Natural
-
Returns a uniformly distributed random integer 0 <= n < max
proc random*[RNG](self: var RNG): float64
-
Returns a uniformly distributed random number 0 <= n < 1
proc random_int*[RNG](self: var RNG; min, max: int): int
-
Returns a uniformly distributed random integer min <= n < max
proc random_int*[RNG](self: var RNG; slice: TSlice[int]): int {.inline.}
-
Returns a uniformly distributed random integer slice.a <= n <= slice.b
proc random_bool*[RNG](self: var RNG): bool {.inline.}
-
Returns a random boolean
proc random*[RNG](self: var RNG; min, max: float): float
-
Returns a uniformly distributed random number min <= n < max
proc random*[RNG](self: var RNG; max: float): float
-
Returns a uniformly distributed random number 0 <= n < max
proc random_choice*[RNG, T](self: var RNG; arr: T): auto {.inline.}
-
Selects a random element (all of them have an equal chance) from a 0-indexed random access container and returns it
proc shuffle*[RNG, T](self: var RNG; arr: var openarray[T])
-
Randomly shuffles elements of an array
proc random_byte*(self: var TMersenneTwister): uint8
-
proc random*(self: var TMersenneTwister): float64
-
proc init_MersenneTwister*(): TMersenneTwister
-
Initializes and returns a new TMersenneTwister
proc seed*(self: var TMersenneTwister; seed: int)
-
Seeds (randomizes) using 32 bits of an integer
proc seed*(self: var TMersenneTwister; seed: openarray[uint8])
-
Seeds (randomizes) using an array of bytes
proc seed*(self: var TMersenneTwister)
-
Seeds (randomizes) using an array of bytes provided by urandom, or, in case of failure, using the current time (with resolution of 1/256 sec)
proc random_byte*(self: var TSystemRandom): uint8
-
proc init_SystemRandom*(): TSystemRandom
-
Initializes and returns a new TSystemRandom
proc random_byte*(): uint8 {.inline.}
-
Alias to MT
proc random*(): float64 {.inline.}
-
Alias to MT
proc random*(max: float): float {.inline.}
-
Alias to MT
proc random*(min, max: float): float {.inline.}
-
Alias to MT
proc random_int*(max: Positive): Natural {.inline.}
-
Alias to MT
proc random_int*(min, max: int): int {.inline.}
-
Alias to MT
proc random_int*(slice: TSlice[int]): int {.inline.}
-
Alias to MT
proc random_bool*(): bool {.inline.}
-
Alias to MT
proc random_choice*[T](arr: T): auto {.inline.}
-
Alias to MT
proc shuffle*[T](arr: var openarray[T]) {.inline.}
-
Alias to MT