Encode and decode Base64 strings with validation
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation.
Email attachments, embedding images in HTML/CSS, API tokens, data URIs, and storing binary data in text-based systems.
Base64 encoding increases the size by approximately 33% due to its 6-bit to 8-bit conversion with padding.
Uses A-Z, a-z, 0-9, +, / (64 characters total) plus = for padding. URL-safe variant uses - and _ instead of + and /.