ExPurpleTiger v0.1.0 ExPurpleTiger View Source

ExPurpleTiger generates animal-based hash digests meant to be memorable and human-readable. This library is suitble for anthropomorphizing project names, crypto addresses, UUIDs, or any complex string of characters that needs to be displayed in a user interface.

Link to this section Summary

Functions

Generates an animal-based hash.

Link to this section Functions

Link to this function

animal_hash(text, opts \\ [])

View Source
animal_hash(String.t(), Keyword.t()) :: {:ok, String.t()} | :error

Generates an animal-based hash.

Options

  • :separator - the separator for the words in the hash, defaults to " ".
  • :style - the style to apply to the words in the hash. The available options are :lowercase (default), :uppercase, and :titlecase.

Examples

iex> ExPurpleTiger.animal_hash("my ugly input string")
{:ok, "rapid grey rattlesnake"}

iex> ExPurpleTiger.animal_hash("my ugly input string", style: :uppercase)
{:ok, "RAPID GREY RATTLESNAKE"}

iex> ExPurpleTiger.animal_hash("my ugly input string", separator: "-", style: :titlecase)
{:ok, "Rapid-Grey-Rattlesnake"}