Base.decode32-exclamation-mark

You're seeing just the function decode32-exclamation-mark, go back to Base module for more information.
Link to this function

decode32!(string, opts \\ [])

View Source

Specs

decode32!(binary(), keyword()) :: binary()

Decodes a base 32 encoded string into a binary string.

An ArgumentError exception is raised if the padding is incorrect or a non-alphabet character is present in the string.

Options

The accepted options are:

  • :case - specifies the character case to accept when decoding
  • :padding - specifies whether to require padding

The values for :case can be:

  • :upper - only allows upper case characters (default)
  • :lower - only allows lower case characters
  • :mixed - allows mixed case characters

The values for :padding can be:

  • true - requires the input string to be padded to the nearest multiple of 8 (default)
  • false - ignores padding from the input string

Examples

iex> Base.decode32!("MZXW6YTBOI======")
"foobar"

iex> Base.decode32!("mzxw6ytboi======", case: :lower)
"foobar"

iex> Base.decode32!("mzXW6ytBOi======", case: :mixed)
"foobar"

iex> Base.decode32!("MZXW6YTBOI", padding: false)
"foobar"