Module / v1.0.0-beta.7

@typed/id

33 unique exports available through this public import path, including their members and aliases.

import * as id from "@typed/id";

Entropy services

  • RandomValues

    class

    Effect service that produces fresh byte arrays of an exact requested length.

ID generation

  • cuid

    variable

    Generates one CUID from the current CuidState service.

  • dnsUuid5

    variable

    Derives deterministic UUID version 5 values in the standard DNS namespace.

  • ksuid

    variable

    Generates a KSUID from the current time and 16 random bytes.

  • nanoId

    variable

    Generates a 21-character NanoId from the current RandomValues service.

  • oidUuid5

    variable

    Derives deterministic UUID version 5 values in the standard OID namespace.

  • ulid

    variable

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

  • urlUuid5

    variable

    Derives deterministic UUID version 5 values in the standard URL namespace.

  • uuid4

    variable

    Generates an RFC UUID version 4 from 16 fresh random bytes.

  • uuid5

    variable

    Derives a deterministic UUID version 5 from a UTF-8 name and 16-byte namespace.

  • uuid7

    variable

    Generates one UUID version 7 from the current Uuid7State.

  • x500Uuid5

    variable

    Derives deterministic UUID version 5 values in the standard X.500 namespace.

ID schemas

  • Cuid

    variable

    Effect Schema and branded string type for 24-character CUID values.

  • Ksuid

    variable

    Effect Schema and branded string type for 27-character KSUID values.

  • NanoId

    variable

    Effect Schema and branded string type for URL-safe Nano IDs.

  • Ulid

    variable

    Effect Schema and branded string type for canonical ULID values.

  • Uuid4

    variable

    Effect Schema and branded string type for RFC UUID version 4 values.

  • Uuid5

    variable

    Effect Schema and branded string type for RFC UUID version 5 values.

  • Uuid7

    variable

    Effect Schema and branded string type for RFC UUID version 7 values.

ID types

  • CuidSeed

    type-alias

    The complete deterministic input used to derive one CUID.

  • Uuid5Namespace

    type-alias

    The exact 16 namespace bytes used in UUID version 5 hashing.

ID validation

  • isCuid

    variable

    Tests whether a string is a valid branded CUID.

  • isKsuid

    variable

    Tests whether a string has the KSUID encoding shape.

  • isNanoId

    variable

    Tests whether a string has the NanoId alphabet and brandable shape.

  • isUlid

    variable

    Tests whether a string is a canonical ULID.

  • isUuid4

    variable

    Tests whether a string is an RFC UUID version 4 value.

  • isUuid5

    variable

    Tests whether a string is an RFC UUID version 5 value.

  • isUuid7

    variable

    Tests whether a string is an RFC UUID version 7 value.

Sequence state

  • CuidState

    class

    Process-local Effect service that supplies sequential CUID seeds.

  • Uuid7Seed

    type-alias

    The validated time, sequence, and entropy used to format one UUID version 7.

  • Uuid7State

    class

    Process-local Effect service that produces monotonic UUID version 7 seeds.

Services

  • Ids

    class

    Unified Effect service for every Typed ID generator.

Time services

  • DateTimes

    class

    Effect service for current epoch milliseconds and Date values.