Skip to content

aerosol/hahash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hahash

Hash Erlang terms into cute names.

I'm not sure if all end up cute. Don't use for anything very serious, just in case.

Usage

iex(1)> Hahash.name self()
"man-bisque-duffel"
iex(2)> Hahash.name true
"automate-relaxed-range"
iex(3)> Hahash.name false
"stagger-symmetric-decision"
iex(4)> Hahash.name 0
"relieve-quick-change"
iex(5)> Hahash.name &Enum.random/1
"board-soft-limburger"

Distribution

While the hashing is consistent and portable (it relies on phash2), the range is pretty small. You should not rely on it, if the hash unicity is critical.

iex(1)> 1..1_000_000 |> Enum.map(fn x -> Hahash.name(x) end) |> Enum.uniq() |> Enum.count()

996785

Installation

def deps do
  [
    {:hahash, "~> 0.2.0"}
  ]
end

About

Hash Erlang terms into cute names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages