Skip to Content

id

Module: vibex/id

ID Generator Utilities for VibeX

Simple, unique ID generation for documents and other entities.

Functions

generateShortId

View source

Generate a short, unique ID that’s URL-safe Uses a custom alphabet to ensure compatibility

function generateShortId(length: number = 8): string

Parameters:

NameTypeDescription
lengthnumberLength of the ID (default: 8) (default: 8)

Returns: A short, unique ID string


generateSpaceId

View source

Generate a space ID

function generateSpaceId(): string

Returns: A space ID like ‘aB3x_9Kp’ (always clean random ID)


validateId

View source

Validate a document ID Checks that the ID starts with a letter and contains only letters, numbers, and underscores

function validateId(id: string): boolean

Parameters:

NameTypeDescription
idstringID string to validate

Returns: Boolean indicating if the ID is valid