Three bytes become four characters
Three bytes are read at a time, joined into 24 bits, and cut into four 6-bit values. Adding 32 to each value maps it to a printable character in the range space through underscore. Every line starts with a length character equal to its raw byte count plus 32, so a full 45-byte line always begins with M; a final line of 1, 2, or 3 bytes yields 2, 3, or 4 characters. Decoding subtracts 32, reassembles the groups, and discards the padding bits of the last character.