← Back to Kairo Docs|API Reference (Dokka)

Id

interface Id

Kairo IDs are an alternative to raw UUIDs or serial IDs. Semantic prefixes (user, business) tell you what they represent. Strong entropy (as much or more randomness than UUIDs, tunable by payload length). Compile-time safety without runtime overhead.

An example Kairo ID is "user_ccU4Rn4DKVjCMqt3d0oAw3". Prefix: "user". Payload: "ccU4Rn4DKVjCMqt3d0oAw3".

Types

Link copied to clipboard
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).

Properties

Link copied to clipboard
abstract val value: String