Kombu.Utils.UUID (Kombu v0.1.0)

Copy Markdown View Source

UUID generation and representation utilities, matching kombu.utils.uuid and kombu.common.oid_from.

Summary

Functions

Format %Kombu.Utils.UUID{} or 32-char hex string into canonical 36-char hyphenated string.

Generate a deterministic object identifier matching kombu.common.oid_from.

Parse a UUID string or 32-character hex string into %Kombu.Utils.UUID{}.

Generate a %Kombu.Utils.UUID{} struct for a random UUID4.

Generate a UUID5 string from a 16-byte namespace binary (or UUID string) and name.

Generate a random UUID4 string ("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").

Types

t()

@type t() :: %Kombu.Utils.UUID{hex: String.t(), version: pos_integer() | nil}

Functions

format(str)

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

Format %Kombu.Utils.UUID{} or 32-char hex string into canonical 36-char hyphenated string.

namespace_oid()

namespace_url()

oid_from(instance)

@spec oid_from(term()) :: String.t()

Generate a deterministic object identifier matching kombu.common.oid_from.

parse!(str)

@spec parse!(String.t()) :: t()

Parse a UUID string or 32-character hex string into %Kombu.Utils.UUID{}.

uuid4()

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

uuid4_struct()

@spec uuid4_struct() :: t()

Generate a %Kombu.Utils.UUID{} struct for a random UUID4.

uuid5(namespace \\ "k\xA7\xB8\x12\x9D\xAD\x11р\xB4\0\xC0O\xD40\xC8", name)

@spec uuid5(binary(), String.t()) :: String.t()

Generate a UUID5 string from a 16-byte namespace binary (or UUID string) and name.

uuid()

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

Generate a random UUID4 string ("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").