Base64 Encoding: RFC 4648, the BaseN Family, and Constant-Time Decoding
A rigorous treatment of Base64 from first principles: the mathematical basis for the 64-character alphabet (2⁶ = largest power-of-two mapping to printable ASCII), RFC 4648 canonical specification, the BaseN encoding family (Base16 through Base85 with size/alphabet trade-offs), streaming encoder and decoder state machines, MIME line-wrapping rules, PEM format anatomy, constant-time decoding for cryptographic contexts, SIMD-accelerated lookup tables, and production boundary advice for JWTs, data URLs, and HTTP Basic Auth.