Skip to main content

rand

Package rand provides cryptographically secure random value generation for durable programs.

load("rand", ...)

rand

load("rand", "rand")

Functions

bytes(length: Int)

Example:

rand.bytes(16)

Parameters:

NameTypeRequiredDescription
lengthInt

Returns: Bytes


int64(max: Int)

Example:

rand.int64(100)
randInt returns a pseudo-random number in the half-open interval [0,n).
When n is omitted, returns a random non-negative int64.

Parameters:

NameTypeRequiredDescription
maxInt

Returns: Int