r/dailyprogrammer_ideas • u/congratz_its_a_bunny • Nov 16 '17
Submitted! [Intermediate?] Base64 Encode/Decode
Not sure if this has been done before. Sorry if it has, and this is a repost.
I read This blog post yesterday and found it rather informative. I found Wikipedia's Base64 article helpful when trying this myself. Also, this site can be used to encode/decode stuff so you can check your answers.
Inspired by that, I thought that writing a program do encode and decode Base64 would be fun.
Input:
2 lines.
First line: 1 character, d or e, to specify whether you want to decode or encode something
Second line: The string to be (de/en)coded
Output: the (de/en)coded string.
View all comments
Show parent comment
2
u/WikiTextBot Nov 17 '17
Ascii85
Ascii85, also called Base85, is a form of binary-to-text encoding developed by Paul E. Rutter for the btoa utility. By using five ASCII characters to represent four bytes of binary data (making the encoded size ¹⁄₄ larger than the original, assuming eight bits per ASCII character), it is more efficient than uuencode or Base64, which use four characters to represent three bytes of data (¹⁄₃ increase, assuming eight bits per ASCII character).
Its main modern uses are in Adobe's PostScript and Portable Document Format file formats, as well as in the patch encoding for binary files used by Git.
[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source | ^Donate ] Downvote to remove | v0.28