Skip to content
Base36 encoder/decoder in Elixir.
Elixir
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE
README.md
mix.exs
mix.lock

README.md

Base36 VersionBuild StatusLicense

Base36 encoder/decoder in Elixir. Based on custom base.

Usage

Encode

iex> Base36.encode(13)
"D"

iex> Base36.encode(31)
"V"

iex> Base36.encode(274)
"7M"

Decode!

iex> Base36.decode!("95")
329

iex> Base36.decode!("TETRAPYRROLE")
3871237878461204546

iex> Base36.decode!("Кириллица")
** (ArgumentError) non-alphabet digit found: а
    (base36) lib/base36.ex:2: Base36.decode_char/1
    (base36) lib/base36.ex:2: Base36.decode/2

Decode

iex> Base36.decode("42")
{:ok, 146}

iex> Base36.decode("ERLANG")
{:ok, 892869676}

iex> Base36.decode("lower")
:error

License

Released under the MIT License.

You can’t perform that action at this time.