Haikunator
Haikunator
Generate Heroku-like memorable random names to use in your apps or anywhere else.
Summary↑
build(range \\ 9999, delimiter \\ "-") | Generate a memorable name |
Functions
Specs:
Generate a memorable name.
range
is the first parameter, and sets the range for the token (i.e. the number) from 0 to n.
Defaults to 9999
.
delimiter
is the second parameter, and it’s the string that joins the sections.
Defaults to "-"
.
Examples
# Default
iex> Haikunator.build # => "morning-star-6817"
# Token range
iex> Haikunator.build(100) # => "summer-dawn-24"
# Don't include the token
iex> Haikunator.build(0) # => "ancient-frost"
# Use a different delimiter
iex> Haikunator.build(9999, ".") # => "frosty.leaf.8347"
# No token, no delimiter
iex> Haikunator.build(0, "") # => "twilightbreeze"