uuid_generate
Generate UUID v4 (random) or v7 (time-ordered with Unix-ms prefix) for identifiers. Use v4 for general purpose; v7 for database keys or tracing that require chronological sorting.
Instructions
Generate a single UUID in either v4 (random) or v7 (time-ordered, Unix-ms prefix) format. Use v4 for general-purpose identifiers; use v7 when UUIDs must sort chronologically by creation time (e.g. database primary keys or distributed tracing). Both versions use cryptographically random bits in their non-timestamp positions. Uses Node.js crypto.randomUUID() for v4 and a spec-compliant implementation for v7; no network calls. Returns a UUID string in canonical xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx format.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | UUID version to generate. v4: fully random (RFC 4122 §4.4). v7: time-ordered with Unix-ms prefix for database-friendly sorting (draft-peabody-dispatch-new-uuid-format). |