View Source Nanoid.Configuration (Nanoid v2.1.0)

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

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.

Functions

@spec default_alphabet() :: binary()

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
@spec default_alphabet_length() :: non_neg_integer()

Returns the length of the default alphabet.

Example

iex> Nanoid.Configuration.default_alphabet_length()
64
@spec default_mask() :: non_neg_integer()

Returns the default mask used by the secure generator.

Example

iex> Nanoid.Configuration.default_mask()
63
@spec default_size() :: non_neg_integer()

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

Example

iex> Nanoid.Configuration.default_mask()
21