   @spec decode32(binary) :: {:ok, binary} | :error
   @spec decode32(binary, Keyword.t) :: {:ok, binary} | :error
   def decode32(string, opts \\ []) do
-    case = Keyword.get(opts, :case, :upper)
-    {:ok, do_decode32(string, decode_case(case, &dec32/1))}
+    {:ok, decode32!(string, opts)}
   rescue
     ArgumentError -> :error
   end

    end
  end

  defp encode_case(:upper, func),
    do: func
  defp encode_case(:lower, func),
    do: &to_lower(func.(&1))

  defp decode_case(:upper, func),
    do: func
  defp decode_case(:lower, func),
    do: &func.(from_lower(&1))
  defp decode_case(:mixed, func),
    do: &func.(from_mixed(&1))

  defp to_lower(char) when char in ?A..?Z,
    do: char + (?a - ?A)
  defp to_lower(char),
    do: char

  defp from_lower(char) when char in ?a..?z,
    do: char - (?a - ?A)

  """
  @spec hex_decode32(binary) :: {:ok, binary} | :error
  @spec hex_decode32(binary, Keyword.t) :: {:ok, binary} | :error
  def hex_decode32(string, opts \\ []) do
    {:ok, hex_decode32!(string, opts)}
  rescue
    ArgumentError -> :error
  end
