Question

A two MByte file needs to be base64 encoded. How much larger (in bytes) does the...

A two MByte file needs to be base64 encoded. How much larger (in bytes) does the file enlarge?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Base64 encodes each set of 3 bytes into 4 bytes.
This means that the size of the base-64 representation of a string of size n is:
ceil(n / 3) * 4
Here the file size if 2MB = 2*1024*1024 = 2097152
So, for a 2MB file, the base-64 representation will be ceil(2*1024*1024/3)*4 = 2796202.67 ~= 2.66MByteslong.

The file will enlarge 699050.67 bytes.

A rough approximation would be increased to 4/3 (33%) of the original.

Add a comment
Know the answer?
Add Answer to:
A two MByte file needs to be base64 encoded. How much larger (in bytes) does the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT