View Source Base45 (base45 v0.1.1)
A library to encode and decode binaries using the base 45 encoding scheme (specified in RFC 9285).
Link to this section Summary
Functions
Decode Base45 strings to binary data. Raises an exception NilValuesError if the string is not valid Base45.
Decode Base45 strings to binary data. Returns nil if the string is not valid Base45.
Encode binary data as Base45
Examples
iex> Base45.encode("Hello")
"%69 VDL2"
iex(1)> Base45.encode(<<0, 1, 127, 129, 255>>)
"100G5GU5"
Encodes a file (which must be open, the argument has to be a file handle or an atom such as :stdio)
Link to this section Functions
Decode Base45 strings to binary data. Raises an exception NilValuesError if the string is not valid Base45.
examples
Examples
iex> Base45.decode!("%69 VDL2")
"Hello"
iex(1)> Base45.decode!("===")
** (NilValuesError) nil value(s)
Decode Base45 strings to binary data. Returns nil if the string is not valid Base45.
examples
Examples
iex> Base45.decode("%69 VDL2")
"Hello"
iex(1)> Base45.decode("100G5GU5")
<<0, 1, 127, 129, 255>>
iex(1)> Base45.decode("===")
nil
Encode binary data as Base45
examples
Examples
iex> Base45.encode("Hello")
"%69 VDL2"
iex(1)> Base45.encode(<<0, 1, 127, 129, 255>>)
"100G5GU5"
Encodes a file (which must be open, the argument has to be a file handle or an atom such as :stdio)