random
native moduleSeedable non-cryptographic PRNG. import "random". For security use crypto.secure_random.
random.seed(n: int)random.int(max: int) => intrandom.int_range(lo, hi: int) => intrandom.float() => floatrandom.bool() => boolrandom.bytes(n: int) => stringrandom.choice(list) => anyrandom.shuffle(list) => listrandom.uuid() => string
random.seed(n: int)
Seed the global RNG for reproducibility.
random.int(max: int) => int
Random int in [0, max) (requires max > 0).
random.int_range(lo, hi: int) => int
Random int in [lo, hi).
random.float() => float
Random float in [0.0, 1.0).
random.bool() => bool
Random boolean.
random.bytes(n: int) => string
n random bytes packed in a string (non-crypto).
random.choice(list) => any
Uniformly-random element of a non-empty list.
random.shuffle(list) => list
Fisher-Yates shuffle in place; returns the list.
random.uuid() => string
Random v4 UUID string.