View Source Moar.UUID (Moar v1.60.0)

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

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

Returns a regex that will match a 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