ShortUUID v0.1.1 ShortUUID
ShortUUID is a simple UUID shortener library.
Installation
Add ShortUUID to your list of dependencies in
mix.exs
:def deps do [{:shortuuid, "~> 0.1.1"}] end
Optionally configure the alphabet to be used for encoding in
config.exs
:config :shortuuid, alphabet: "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
The default alphabet (above) will translate UUIDs to base57 using lowercase and uppercase letters and digits while avoiding similar-looking characters such as l, 1, I, O and 0.
Typical usage
Use ShortUUID to shorten UUID strings generated by other libraries such as Ecto, Elixir UUID and Erlang UUID.
Acknowledgments
This project was inspired by skorokithakis/shortuuid.
Link to this section Summary
Link to this section Functions
Convert a shortened UUID back to a full size UUID.
Examples
iex> ShortUUID.decode("keATfB8JP2ggT7U9JZrpV9")
"2a162ee5-02f4-4701-9e87-72762cbce5e2"