View Source ShortUUID (ShortUUID v4.0.0)
ShortUUID is a module for encoding and decoding UUIDs using a base57 alphabet.
Functions
encode/1
- Encodes a UUID into a shorter string using base57 alphabetencode!/1
- Same as encode/1 but raises an error on failuredecode/1
- Decodes a shortened string back into a UUIDdecode!/1
- Same as decode/1 but raises an error on failure
Example
iex> ShortUUID.encode("550e8400-e29b-41d4-a716-446655440000")
{:ok, "H9cNmGXLEc8NWcZzSThA9S"}
iex> ShortUUID.decode("H9cNmGXLEc8NWcZzSThA9S")
{:ok, "550e8400-e29b-41d4-a716-446655440000"}
For custom alphabets and more options, see ShortUUID.Builder
.