Base64 length calculation?
Each character is used to represent 6 bits (log2(64) = 6). Therefore 4 chars are used to represent 4 * 6 = 24 bits = 3 bytes. So you need 4*(n/3) chars to represent n bytes, and this needs to be rounded up to a multiple of 4. The number of unused padding chars resulting … Read more