Business Data Communication Book (Sixth Edition) Author: William Stallings PLEAS
ID: 3742156 • Letter: B
Question
Business Data Communication Book (Sixth Edition)
Author: William Stallings
PLEASE DON'T POST SPAM! & Thanks!
Base64 encoding allows arbitrary sequences of octets to be represented by printable characters. The encoding process represents 24-bit groups of input bits as strings of four encoded characters. The 24-bit groups are formed by concatenating three octets. These 24-bit groups are then treated as four concatenated 6-bit groups, each of which is translated to a character of the Base64 alphabet. The encoded output stream is represented by lines of no more than 76 printable characters, with line breaks being indicated by the “CR, LF” character sequence. How much will a file be expanded by encoding it with Base64?
Explanation / Answer
Let's say, the user gives a text with 3 characters (3 octets). These 3 octets will be converted to 4 characters of Base64 encoding (According to the procedure mentioned above)
4 Base64 characters = 3 octets
76 Base64 characters = 3 * 76 / 4 octets
= 57 octets
After every 57 octets, 6 characters ('C', 'R', ',', ' ', 'L', 'F') will be added.
6 Base64 characters = 3 * 6 / 4 octets
= 4.5 octets
That implies, (57 - 4.5) octets will be converted to one line
So, 52.5 octets will be converted to 76 Base64 characters.
If we calculate the ratio: 76/52.5 = 1.4476
So, the file will be expanded by 1.4476 times by encoding it with Base64.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.