mirror of
https://github.com/sloanelybutsurely/typeid-elixir.git
synced 2024-11-28 01:42:54 -05:00
add comments to base 32 module
This commit is contained in:
parent
a9c52b8496
commit
b34945f79d
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue