90. Base64 encoding and decoding

Base64 is an encoding scheme used for representing binary data in ASCII format using an alphabet of 64 characters. Although all implementations use the same first 62 characters (A-Z, a-z, and 0-9), the last two values may differ. The symbols + and / are used in the MIME specification. A base64 digit represents 6 bits of data, and four base64 digits encode exactly three bytes (8-bit) of binary data. When the number of digits is not divisible by three, extra bytes with a value of zero are added before converting to base64. Padding the encoded text with == or = can be used to indicate that the final group of three bytes from the plain data actually contained only one or two bytes.

Here is an example of encoding ...

Get The Modern C++ Challenge now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.