FlexId

This library is inspired by two different id generation strategies: type 1 UUIDs, and Instragam's Ids.

The exact division is configurable, but the following guidelines should be followed:

The order of the components is debatable, but this implementation adopts the same order as type 1 UUIDs which results in an order of decreasing change; time, sequence, partition.
This differs from the order adopted by Instagram, so this library cannot be used to generate Instagram compatible Ids.

There are many ways that you may decide to partition your ID space:

Other strategies for generating IDs that aren't very interesting are:

Further Reading:

Installation

If available in Hex, the package can be installed by adding flexid to your list of dependencies in mix.exs:

def deps do
  [{:flexid, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/flexid.