Dextrin.ObjectId (Dextrin v0.3.3)

Copy Markdown View Source

DXN objectid (@objectid "...", Jan, 2026-10-20): BSON's 12-byte ObjectId, built in like uuid -- readable in text, its raw bytes in .dxnb. The value holds the bytes; the 24 hex digits exist only at the text boundary.

iex> {:ok, id} = Dextrin.ObjectId.parse("507F1F77BCF86CD799439011")
iex> Dextrin.ObjectId.format(id)
"507f1f77bcf86cd799439011"

Summary

Functions

The 24 lowercase hex digits.

An ObjectId from its 12 raw bytes.

Parses 24 hex digits, either case.

Types

t()

@type t() :: %Dextrin.ObjectId{bytes: <<_::96>>}

Functions

format(object_id)

@spec format(t()) :: String.t()

The 24 lowercase hex digits.

new(arg)

@spec new(<<_::96>>) :: t()

An ObjectId from its 12 raw bytes.

parse(arg1)

@spec parse(String.t()) :: {:ok, t()} | {:error, :invalid_objectid}

Parses 24 hex digits, either case.