Here’s the translated code and explanation in Ada, formatted in Markdown suitable for Hugo:
Ada provides built-in support for base64 encoding/decoding through the GNAT.Encode_Base64 and GNAT.Decode_Base64 packages.
To run the program, save it as base64_encoding.adb and use the following commands:
Ada’s standard library provides base64 encoding and decoding through the GNAT packages. However, it doesn’t have a built-in URL-compatible base64 format. If you need URL-safe encoding, you would need to implement it yourself or use a third-party library.
The encoded string in Ada will be the same as the standard base64 encoding in other languages. However, Ada doesn’t provide a direct equivalent to the URL-safe encoding out of the box.