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:
| Name | Type | Required | Description |
|---|---|---|---|
length | Int | ✓ |
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:
| Name | Type | Required | Description |
|---|---|---|---|
max | Int | ✓ |
Returns: Int