random

package
v0.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package random exposes random values to Meow programs.

Roll, Drift and Pick draw from math/rand/v2, which is fine for sampling and jitter. Tuft draws from crypto/rand instead, because it exists to label things — a marker that collides, or that an observer can predict, defeats the purpose of having one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drift

func Drift(args ...meowrt.Value) meowrt.Value

Drift returns a random float in [0, 1).

func Pick

func Pick(args ...meowrt.Value) meowrt.Value

Pick returns a random element of a litter.

func Roll

func Roll(args ...meowrt.Value) meowrt.Value

Roll returns a random integer in [0, n).

func Tuft

func Tuft(args ...meowrt.Value) meowrt.Value

Tuft returns n random bytes as a lowercase hex string, so the result is 2n characters long. It is drawn from a cryptographic source, which makes it suitable for the markers and correlation IDs it is meant for.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL