Moar.UUID (Moar v2.5.0)

View Source

UUID-related functions

Summary

Functions

Returns a regex that will match a UUID

Returns true if the argument is a valid UUID, or false if it is nil or an invalid UUID.

Functions

regex()

@spec regex() :: Regex.t()

Returns a regex that will match a UUID

valid?(uuid)

@spec valid?(nil | binary()) :: boolean()

Returns true if the argument is a valid UUID, or false if it is nil or an invalid UUID.

iex> Moar.UUID.valid?(nil)
false

iex> Moar.UUID.valid?("cows")
false

iex> Moar.UUID.valid?("a3357225-ed23-48b6-9ce5-10a580489b3f")
true