Uniq

Uniq provides generation, formatting, parsing, and analysis of RFC 4122 UUIDs, with support for the draft UUIDv6 extension. It is a package for Elixir projects, and can be found on Hex as :uniq.

Features

Usage

The primary API is provided by the Uniq.UUID module.

To generate UUIDs, pick the version you want, and call the appropriate generator. For example:

See the docs for the full set of functions available.

You can also convert UUID strings to/from the human-readable and binary formats; parse UUID strings/binaries; and determine their validity.

If you are replacing elixir_uuid with this library, you can continue to use the UUID module, as uniq defines it when not present, and exposes the same interface that elixir_uuid does.

Ecto

You can use the type provided by this library in lieu of Ecto.UUID, simply use Uniq.UUID where you would use Ecto.UUID, and specify :binary_id as the type of the column in your migrations.

Installation

def deps do
  [
    {:uniq, "~> 0.1"}
  ]
end

License

Apache 2.0. See LICENSE.md for the full text.