View Source Base36 (Base36 v1.0.1)

This module provides data encoding and decoding functions for base36 alphabet:

ValueEncodingValueEncodingValueEncodingValueEncoding
009918I27R
1110A19J28S
2211B20K29T
3312C21L30U
4413D22M31V
5514E23N32W
6615F24O33X
7716G25P34Y
8817H26Q35Z

Link to this section Summary

Functions

Decode base 36 char from alphabet above to base 10 integer.

Same as decode/1 except this function return just number or raise error if binary can not be converted.

Encode base 10 integer to base 36 char from alphabet above.

Link to this section Functions

@spec decode(binary()) :: {:ok, integer()} | :error

Decode base 36 char from alphabet above to base 10 integer.

Returns tuple {:ok, number} if binary can be converted using alphabet, :error instead.

@spec decode!(binary()) :: integer()

Same as decode/1 except this function return just number or raise error if binary can not be converted.

@spec encode(integer()) :: binary()

Encode base 10 integer to base 36 char from alphabet above.