@fungi.computer/cairn
Variables
Section titled “Variables”identifierDefinitionSchema
Section titled “identifierDefinitionSchema”
constidentifierDefinitionSchema:ZodObject<{family:ZodString;version:ZodLiteral<1>>;kinds:ZodRecord<ZodString,ZodObject<{prefix:ZodString; },$strip>>>>; },$strip>>
Validate one bounded version 1 family declaration.
identifierCandidateSchema
Section titled “identifierCandidateSchema”
constidentifierCandidateSchema:ZodString
Decode a wire candidate before calling a typed string codec.
ALPHABET
Section titled “ALPHABET”
constALPHABET:"abcdefghijklmnopqrstuvwxyz0123456789"="abcdefghijklmnopqrstuvwxyz0123456789"
URL-safe lowercase alphabet used for opaque identifiers.
constSHORT:8=8
Identifier size for compact, non-security-sensitive labels.
DEFAULT
Section titled “DEFAULT”
constDEFAULT:21=21
Default identifier size.
constLONG:32=32
Identifier size for callers that require additional collision resistance.
Functions
Section titled “Functions”nanoid()
Section titled “nanoid()”nanoid(
length?):string
Generate a raw opaque identifier through the runtime-selected nanoid implementation.
Parameters
Section titled “Parameters”length?
Section titled “length?”number = DEFAULT
Requested output size; supply a bounded nonnegative integer unless accepting upstream/runtime-specific behavior.
Returns
Section titled “Returns”string
A lowercase alphanumeric identifier.
Remarks
Section titled “Remarks”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.
Throws
Section titled “Throws”If length is positive or negative infinity. Other finite-size exceptions
follow the upstream runtime behavior.
References
Section titled “References”CairnDefinitionError
Section titled “CairnDefinitionError”Re-exports CairnDefinitionError
CairnGenerationError
Section titled “CairnGenerationError”Re-exports CairnGenerationError
defineIdFamily
Section titled “defineIdFamily”Re-exports defineIdFamily
CairnId
Section titled “CairnId”Re-exports CairnId
IdCodec
Section titled “IdCodec”Re-exports IdCodec
IdFamily
Section titled “IdFamily”Re-exports IdFamily
IdKindDefinition
Section titled “IdKindDefinition”Re-exports IdKindDefinition
Re-exports IdOf
IdParseError
Section titled “IdParseError”Re-exports IdParseError
IdParseResult
Section titled “IdParseResult”Re-exports IdParseResult
ADJECTIVES
Section titled “ADJECTIVES”Re-exports ADJECTIVES
Re-exports NOUNS
Re-exports words
replayKey
Section titled “replayKey”Re-exports replayKey
correlationKey
Section titled “correlationKey”Re-exports correlationKey
createCorrelationSequence
Section titled “createCorrelationSequence”Re-exports createCorrelationSequence
ReplayKey
Section titled “ReplayKey”Re-exports ReplayKey
CorrelationKey
Section titled “CorrelationKey”Re-exports CorrelationKey