Nanoid v2.0.3 Nanoid.Configuration View Source

Configuration module used by NanoID generators to get the required configuration.

Link to this section Summary

Functions

Returns the default alphabet of a nanoid used by the generators.

Returns the length of the default alphabet.

Returns the default mask used by the secure generator.

Returns the default size of a nanoid used by the generators.

Link to this section Functions

Link to this function

default_alphabet()

View Source
default_alphabet() :: String.t()

Returns the default alphabet of a nanoid used by the generators.

Example

iex> Nanoid.Configuration.default_alphabet()
"_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Link to this function

default_alphabet_length()

View Source
default_alphabet_length() :: Integer.t()

Returns the length of the default alphabet.

Example

iex> Nanoid.Configuration.default_alphabet_length()
64
Link to this function

default_mask()

View Source
default_mask() :: Integer.t()

Returns the default mask used by the secure generator.

Example

iex> Nanoid.Configuration.default_mask()
63
Link to this function

default_size()

View Source
default_size() :: Integer.t()

Returns the default size of a nanoid used by the generators.

Example

iex> Nanoid.Configuration.default_mask()
21