Uniq.UUID.parse

You're seeing just the function parse, go back to Uniq.UUID module for more information.

Specs

parse(binary()) :: {:ok, info()} | {:error, term()}

Parses a Elixir.Uniq.UUID from a binary.

Supported formats include human-readable strings, as well as the raw binary form of the UUID.

Examples

iex> {:ok, uuid} = Uniq.UUID.parse("f81d4fae-7dec-11d0-a765-00a0c91e6bf6")
{:ok, %Uniq.UUID{
  bytes: <<248, 29, 79, 174, 125, 236, 17, 208, 167, 101, 0, 160, 201, 30, 107, 246>>,
  format: :default,
  node: <<0, 160, 201, 30, 107, 246>>,
  seq: 10085,
  time: 130742845922168750,
  variant: <<2::size(2)>>,
  version: 1
}}
...> {:ok, %Uniq.UUID{uuid | format: :urn}} == Uniq.UUID.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6")
true

iex> match?({:ok, %Uniq.UUID{format: :default, version: 1}}, Uniq.UUID.uuid1() |> Uniq.UUID.parse())
true