Skip to content

random-id resource

Description

ID generates cryptographically random identifiers.

Source: internal/random/id_rsrc.go:17

Example usage:

imports: {
  std: 'github.com/cloudboss/unobin-library-std'
}

resources: {
  example: std.random-id {
    # Set input fields here.
  }
}

Inputs

byte-length

integer

required

ByteLength is the number of random bytes to generate and must be at least one.

keepers

optional(map(string))

Keepers requests a new identifier when any map value changes.

prefix

optional(string)

Prefix is prepended verbatim to every encoded output except ID.

Input Constraints

Byte length rules

byte-length must be at least 1.

Rule logic
Require
input.byte-length >= 1

Outputs

id

string

b64-url

string

b64-std

string

dec

string

hex

string