BCUtils.UuidHelper (bc_utils v0.15.0)

Helper functions for working with UUIDs.

Summary

Functions

Validates if the given input is a valid UUID.

Functions

validate(uuid)

@spec validate(String.t() | binary()) :: boolean()

Validates if the given input is a valid UUID.

Accepts either a UUID string or a binary UUID.

Examples

iex> UuidHelper.validate("550e8400-e29b-41d4-a716-446655440000")
true

iex> UuidHelper.validate("not-a-uuid")
false

iex> UuidHelper.validate(<<85, 14, 132, 0, 226, 155, 65, 212, 167, 22, 68, 102, 85, 68, 0, 0>>)
true