Search documentation of phoenix_kit

# PhoenixKit.Utils.UUID (phoenix_kit v1.7.87)

Copy Markdown View Source

Utilities for working with UUIDs.

## Summary

### Functions

valid?(string)

Checks if a string is a valid UUID.

## Functions

# valid?(string)

Checks if a string is a valid UUID.

Uses `Ecto.UUID.cast/1` for robust validation that handles all UUID formats (v4, v7, etc.).

## Examples

    iex> PhoenixKit.Utils.UUID.valid?("550e8400-e29b-41d4-a716-446655440000")
    true

    iex> PhoenixKit.Utils.UUID.valid?("not-a-uuid")
    false

    iex> PhoenixKit.Utils.UUID.valid?(123)
    false