Module based.32.crockford
Implements Crockford’s Base32 encoding
Functions
encode (data) | Encodes a value into Base32. |
decode (data[, mode="string"]) | Decodes a Base32-encoded value. |
Functions
- encode (data)
-
Encodes a value into Base32.
Supported types are string and
number
. Strings will be encoded byte-wise with padding bits at the end, while numbers will be encoded all at once with leading zeroes at the start.Parameters:
- data string A string treated as binary data
Returns:
-
string
The Base32 encoded input data
- decode (data[, mode="string"])
-
Decodes a Base32-encoded value.
Parameters:
- data string Base32 encoded data
- mode string Either ‘string’ or ‘number’ to specify what type to decode as (default "string")
Returns:
-
The decoded input data