magus v0.4.2 is out. See what's new
¶ View generated markdown
1 min read

uuid

Unique identifiers and random tokens (v4 random, v7 time-ordered, plus raw random hex/tokens).

Naming convention: import the module under its bare name (import "uuid"), reach members with a backslash, and call methods in camelCase: uuid\someMethod.

Methods

v4

A random (version 4) UUID string, e.g. "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d".

Signature: uuid\v4() -> string - source

Returns: string

v7

A time-ordered (version 7) UUID string; lexically sorts by creation time, which makes it a good ordered run/build id.

Signature: uuid\v7() -> string - source

Returns: string

randomHex

A cryptographically random lowercase hex string of n bytes (2*n characters); errors when n is not positive.

Signature: uuid\randomHex(n) -> string - source

Parameter Type Optional Description
n int

Returns: string

randomToken

A cryptographically random URL-safe base64 token from n bytes of entropy (no padding); errors when n is not positive.

Signature: uuid\randomToken(n) -> string - source

Parameter Type Optional Description
n int

Returns: string

generatedreference/buzz/uuidmodulestdlibmagusfile
Last updated (4f8cc295)
Earlier changes on this page (4)

Full history ↗ · Blame source ↗

Glossary

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. See targets.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. See the module reference.

Buzz

The language magusfiles are written in (the .buzz engine). See engines.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.