Expand description
UUID and token generation helpers.
The module provides plain random tokens as well as retry helpers for business-unique UUIDs. Callers remain responsible for enforcing uniqueness at the database layer, but the helpers centralize collision retry loops and error messages.
Enums§
- Unique
Uuid Attempt - Result of attempting to reserve or accept a generated UUID.
Constants§
- UNIQUE_
UUID_ MAX_ ATTEMPTS - Maximum number of UUID candidates generated by unique UUID helpers.
Functions§
- new_
best_ effort_ uuid - Generates a business UUID and filters occupied candidates through caller-provided lookup.
- new_
runtime_ id - Generates an ephemeral runtime instance identifier.
- new_
short_ token - Generates a short 32-character hex token.
- new_
uuid - Generates a UUID v4 string.
- with_
unique_ uuid - Runs an operation with a business-unique UUID and caller-owned error type.