> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UUID Tools

> Generate UUIDs, NanoIDs, ULIDs, and custom format IDs.

The UUID Tools connector generates unique identifiers in various formats: UUID v4, UUID v7, NanoID, ULID, and custom patterns.

<Note>No connection required; this utility connector works out of the box.</Note>

## Tools

<AccordionGroup>
  <Accordion title="generate: Generate UUID v4">
    Generate random UUID v4 identifiers.

    <ParamField body="count" type="number" default="1">
      Number of UUIDs to generate.
    </ParamField>

    <ParamField body="uppercase" type="boolean" default="false">
      Use uppercase characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "count": 3 }
    ```

    **Example response:**

    ```json theme={null}
    {
      "items": [
        "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
      ],
      "count": 3,
      "version": 4
    }
    ```
  </Accordion>

  <Accordion title="generate-v7: Generate UUID v7">
    Generate time-ordered UUID v7 identifiers (sortable by creation time).

    <ParamField body="count" type="number" default="1">
      Number of UUIDs to generate.
    </ParamField>

    <ParamField body="uppercase" type="boolean" default="false">
      Use uppercase characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "count": 1, "uppercase": true }
    ```

    **Example response:**

    ```json theme={null}
    {
      "items": [
        "019049E6-3B8A-7D4F-9C2E-1A5B3D7F8E0C"
      ],
      "count": 1,
      "version": 7
    }
    ```
  </Accordion>

  <Accordion title="validate: Validate UUID">
    Check if a string is a valid UUID.

    <ParamField body="uuid" type="string" required>
      String to validate.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479" }
    ```

    **Example response:**

    ```json theme={null}
    {
      "valid": true,
      "version": 4
    }
    ```
  </Accordion>

  <Accordion title="parse: Parse UUID">
    Extract version, variant, and other components from a UUID.

    <ParamField body="uuid" type="string" required>
      UUID to parse.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479" }
    ```

    **Example response:**

    ```json theme={null}
    {
      "valid": true,
      "version": 4,
      "variant": "RFC 4122",
      "hex": "f47ac10b58cc4372a5670e02b2c3d479",
      "parts": {
        "timeLow": "f47ac10b",
        "timeMid": "58cc",
        "timeHighAndVersion": "4372",
        "clockSeqAndReserved": "a5",
        "clockSeqLow": "67",
        "node": "0e02b2c3d479"
      }
    }
    ```
  </Accordion>

  <Accordion title="nanoid: Generate NanoID">
    Generate compact, URL-safe unique identifiers.

    <ParamField body="size" type="number" default="21">
      Length of the ID.
    </ParamField>

    <ParamField body="count" type="number" default="1">
      Number of IDs to generate.
    </ParamField>

    <ParamField body="alphabet" type="string">
      Custom alphabet characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "size": 12, "count": 2 }
    ```

    **Example response:**

    ```json theme={null}
    {
      "items": [
        "V1StGXR8_Z5j",
        "kP3mQ7xW9yLn"
      ],
      "count": 2
    }
    ```
  </Accordion>

  <Accordion title="ulid: Generate ULID">
    Generate Universally Unique Lexicographically Sortable Identifiers.

    <ParamField body="count" type="number" default="1">
      Number of ULIDs to generate.
    </ParamField>

    <ParamField body="lowercase" type="boolean" default="false">
      Use lowercase characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "count": 1 }
    ```

    **Example response:**

    ```json theme={null}
    {
      "items": [
        "01HY5E3QVNXKJ2R8GZMTPB4WFC"
      ],
      "count": 1
    }
    ```
  </Accordion>

  <Accordion title="ulid-timestamp: Extract ULID timestamp">
    Extract the timestamp encoded in a ULID.

    <ParamField body="ulid" type="string" required>
      ULID to extract timestamp from.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "ulid": "01HY5E3QVNXKJ2R8GZMTPB4WFC" }
    ```

    **Example response:**

    ```json theme={null}
    {
      "timestamp": 1716480000000,
      "iso": "2024-05-23T17:20:00.000Z"
    }
    ```
  </Accordion>

  <Accordion title="custom: Generate custom format ID">
    Generate an ID with a custom format, prefix, and character set.

    <ParamField body="prefix" type="string" default="">
      ID prefix (e.g., `usr_`, `ord_`).
    </ParamField>

    <ParamField body="length" type="number" default="12">
      Length of the random part.
    </ParamField>

    <ParamField body="charset" type="string" default="alphanumeric">
      Character set: `alphanumeric`, `numeric`, `hex`, `alpha`, or `custom`.
    </ParamField>

    <ParamField body="customChars" type="string">
      Custom character set (when `charset` is `custom`).
    </ParamField>

    <ParamField body="separator" type="string">
      Separator character to insert.
    </ParamField>

    <ParamField body="separatorEvery" type="number" default="4">
      Insert separator every N characters.
    </ParamField>

    <ParamField body="uppercase" type="boolean" default="false">
      Use uppercase characters.
    </ParamField>

    <ParamField body="count" type="number" default="1">
      Number of IDs to generate.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "prefix": "ord_",
      "length": 16,
      "charset": "hex",
      "separator": "-",
      "separatorEvery": 4,
      "uppercase": true
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "items": [
        "ord_A3F1-B7C2-D9E4-F506"
      ],
      "count": 1
    }
    ```
  </Accordion>
</AccordionGroup>
