π Encoding Principles & The 64-Char Index
Base64 takes 8-bit binary data (raw bytes with 256 possible values) and converts it into a safe 64-character subset of 7-bit ASCII characters. Because 2^6 = 64, every 6 bits of binary data corresponds to exactly one ASCII character.
When three 8-bit bytes (24 bits total) are processed, they produce four 6-bit Base64 characters. If input byte lengths are not divisible by three, trailing padding characters (= or ==) are appended automatically.