cue-lang / docs-and-content

A place to discuss, plan, and track documentation on cuelang.org
5 stars 1 forks source link

docs/howto/generate-random-uuid: How to generate a random UUID #110

Open jpluscplusm opened 3 months ago

jpluscplusm commented 3 months ago

Slack thread: https://cuelang.slack.com/archives/CLT4FD7KP/p1708980558122439?thread_ts=1708969062.779309&cid=CLT4FD7KP

exec cue export -T file.cue
-- file.cue --
import "uuid"

#seed: uint128 @tag(seed,var=rand)
u:     uuid.FromInt(#seed)

Extension: deriving multiple random UUID from the one initial seed?