macula_id (macula v0.20.5)
View SourceID generation utilities for Macula. Provides functions for generating various types of IDs.
Summary
Functions
Convert hex string to binary. Crashes on invalid hex - exposes bugs in validation logic.
Convert UUID string to 16-byte binary ID. Crashes on invalid UUID format - exposes bugs in validation logic.
Generate deterministic 256-bit hash ID from data.
Generate 128-bit (16-byte) random message ID.
Generate 256-bit (32-byte) random node ID.
Generate 128-bit (16-byte) random session ID.
Convert binary to lowercase hex string.
Convert 16-byte or 32-byte binary ID to UUID string format. For 16-byte: 8-4-4-4-12 (e.g., "12345678-90ab-cdef-1234-567890abcdef") For 32-byte: Uses first 16 bytes
Functions
Convert hex string to binary. Crashes on invalid hex - exposes bugs in validation logic.
Convert UUID string to 16-byte binary ID. Crashes on invalid UUID format - exposes bugs in validation logic.
Generate deterministic 256-bit hash ID from data.
-spec message_id() -> binary().
Generate 128-bit (16-byte) random message ID.
-spec node_id() -> binary().
Generate 256-bit (32-byte) random node ID.
-spec session_id() -> binary().
Generate 128-bit (16-byte) random session ID.
Convert binary to lowercase hex string.
Convert 16-byte or 32-byte binary ID to UUID string format. For 16-byte: 8-4-4-4-12 (e.g., "12345678-90ab-cdef-1234-567890abcdef") For 32-byte: Uses first 16 bytes