talira

Nanoid (Elixir)

Elixir port of Nano ID, a tiny, secure, URL-friendly unique ID generator

open sourceMITfree

An Elixir port of Nano ID, which generates short, URL-friendly unique string IDs: 21 symbols from a larger alphabet (A-Za-z0-9_-) where a UUID takes 36. Its default generator uses cryptographically strong random bytes (:crypto.strong_rand_bytes/1), a faster non-secure generator uses :rand, and custom alphabets may contain multi-byte graphemes such as emoji.

Problems it solves

  • generate short unique IDs in Elixir
  • create URL-safe random IDs instead of UUIDs in Phoenix
  • generate IDs from a custom alphabet in Elixir

Features

  • secure IDs from cryptographically strong random bytes
  • non-secure faster generator
  • custom alphabets including Unicode graphemes
  • 21-character URL-friendly IDs by default

Alternatives

The same job

These do what Nanoid (Elixir) does.

  1. Uniq UUID generation, parsing and formatting for Elixir
  2. uuid (Erlang) Erlang native UUID generation

Compare Nanoid (Elixir) with the top 3