variable / @typed/id/Ulid

ulid

Generates a ULID from the current millisecond time and random bytes.

Package version
1.0.0-beta.7
Category
ID generation
Since
1.0.0

Import

import { ulid } from "@typed/id/Ulid";

Signatures

export declare const ulid: Effect.Effect<Ulid, Cause.IllegalArgumentError, RandomValues | DateTimes>;

Why

Time and entropy remain explicit services; unsafe, negative, or out-of-range 48-bit timestamps fail with IllegalArgumentError.

Ownership and lifetime

The Effect acquires no persistent resources and uses DateTimes and RandomValues only for the invocation.

Examples

import { ulid } from "@typed/id/Ulid"
import { Ids } from "@typed/id/Ids"
import { Effect } from "effect"
const id = Effect.provide(ulid, Ids.Default)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source