diff --git a/lib/type_id/base32.ex b/lib/type_id/base32.ex index 16d4191..1bacc25 100644 --- a/lib/type_id/base32.ex +++ b/lib/type_id/base32.ex @@ -1,6 +1,12 @@ defmodule TypeID.Base32 do + @moduledoc false import Bitwise + # Implements base 32 encoding using the a lowercase crockford alphabet + # https://www.crockford.com/base32.html + + # Borrows heavily from the core `Base` module's implementation + crockford_alphabet = ~c"0123456789ABCDEFGHJKMNPQRSTVWXYZ" to_lower_enc = &Enum.map(&1, fn c -> if c in ?A..?Z, do: c - ?A + ?a, else: c end)