Skip to content

@fungi.computer/cairn

const identifierDefinitionSchema: ZodObject<{ family: ZodString; version: ZodLiteral<1>>; kinds: ZodRecord<ZodString, ZodObject<{ prefix: ZodString; }, $strip>>>>; }, $strip>>

Validate one bounded version 1 family declaration.


const identifierCandidateSchema: ZodString

Decode a wire candidate before calling a typed string codec.


const ALPHABET: "abcdefghijklmnopqrstuvwxyz0123456789" = "abcdefghijklmnopqrstuvwxyz0123456789"

URL-safe lowercase alphabet used for opaque identifiers.


const SHORT: 8 = 8

Identifier size for compact, non-security-sensitive labels.


const DEFAULT: 21 = 21

Default identifier size.


const LONG: 32 = 32

Identifier size for callers that require additional collision resistance.

nanoid(length?): string

Generate a raw opaque identifier through the runtime-selected nanoid implementation.

number = DEFAULT

Requested output size; supply a bounded nonnegative integer unless accepting upstream/runtime-specific behavior.

string

A lowercase alphanumeric identifier.

This legacy helper accepts trusted sizing-policy inputs; CPU and output scale with the requested size. Finite sizing values delegate exactly to the runtime-selected upstream implementation and may be runtime-specific. Callers should supply a bounded nonnegative integer unless they consciously accept upstream/runtime-specific behavior. Only positive and negative infinity receive Cairn’s fixed bounded RangeError. For new durable identifiers, use defineIdFamily.

If length is positive or negative infinity. Other finite-size exceptions follow the upstream runtime behavior.

Re-exports CairnDefinitionError


Re-exports CairnGenerationError


Re-exports defineIdFamily


Re-exports CairnId


Re-exports IdCodec


Re-exports IdFamily


Re-exports IdKindDefinition


Re-exports IdOf


Re-exports IdParseError


Re-exports IdParseResult


Re-exports ADJECTIVES


Re-exports NOUNS


Re-exports words


Re-exports replayKey


Re-exports correlationKey


Re-exports createCorrelationSequence


Re-exports ReplayKey


Re-exports CorrelationKey