![]() ![]() ![]() "dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo" "dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu" "IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg" "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz" "generation of knowledge, exceeds the short vehemence of any carnal pleasure." "which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable " "Man is distinguished, not only by his reason, but by this singular passion from other animals, " ![]() The implementation checks out and produces correct encoded strings and decoded data □ Below is the test program. I wrote a program that encodes and decodes an input string, checks the original against the decoded one, and also checks the encoded base64 text against reference base64 string taken from wiki. I beautified the code and brought it closer to modern C++ □ So now you have a header only, clean base64 encode and decode functions you can use in your projects: base64.hpp. Their C++ implementation (released to public domain so I could freely use and modify it) was my starting point. So I looked for a reference implementation and found one at. I was looking for a library that has built in, easy to use and clean base64 encoding and decoding functions but didn’t really find anything to my liking. For every 3 bytes of input you get 4 bytes of output, so it’s not crazy inflated. Base64 encoding: turning binary data into ASCII text for the purpose of saving it to text files like XML, or transmitting it over protocols like HTTP, or embedding it into web page files, and many other purposed. ![]()
0 Comments
Leave a Reply. |