← Back to Kairo Docs|API Reference (Dokka)

Companion

abstract class Companion<T : Id>(length: Int = 15)

Base companion for ID types. Provides random generation and regex validation helpers. The payload length (5-32 characters) defaults to 15 (~89 bits of entropy).

Constructors

Link copied to clipboard
constructor(length: Int = 15)

Functions

Link copied to clipboard
fun random(): T

Generates a new random ID with a base-62 encoded payload.