janlelis / yyid.ex

Almost a random UUID in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YYID [travis]

Generates random tokens that look like type 4 UUIDs: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

In contrast to RFC 4122, it uses all digits (128bit)

Source of randomness: :crypto.strong_rand_bytes

Install

Add to mix.exs:

defp deps do
  [{:yyid, "~> 0.1"}]
end

Then run in your shell:

$ mix deps.get

Usage

YYID.new # => "e1d87f6e-fbd5-6801-9528-a1d568c1fd02"

Also Available

About

Almost a random UUID in Elixir

License:MIT License


Languages

Language:Elixir 100.0%