Base64 Encode Decode in Elixir

Published on 16 June 2026 (Updated: 16 June 2026)

Welcome to the Base64 Encode Decode in Elixir page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

case System.argv() do
  ["encode", str] when byte_size(str) > 0 ->
    Base.encode64(str) |> IO.puts()

  ["decode", str] when byte_size(str) > 0 ->
    case Base.decode64(str) do
      {:ok, res} -> IO.puts(res)
      _ -> IO.puts("Usage: please provide a mode and a string to encode/decode")
    end

  _ ->
    IO.puts("Usage: please provide a mode and a string to encode/decode")
end

Base64 Encode Decode in Elixir was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.