Tuesday, January 14, 2014

3:39 PM
Good day!

Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding.
Base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that is designed to deal with textual data. This is to ensure that the data remains intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME, and storing complex data in XML.

The traditional (MIME) base64 encoding and decoding processes are fairly simple to implement. Here an example using JavaScript is given, including the MIME/etc required line breaks at particular line lengths. It is worth noting however, that many base64 functions (e.g. in PHP) return base64 encoded strings without the line breaks, as the line breaks can be inserted easily after encoding, and many times the base64 encoding is desired only for safely transferring data via XML or inserting into a database, etc. — times when the line breaks are known to be unnecessary and therefore undesirable. The newline inserting and removing in these functions here can easily be commented out (they are each only one line in the respective functions) if they are not needed.

Here, I just want to share my first python script, the pyb64.py
This python script is created for encoding/decoding strings data usually used in encoding in emails and xml or links.
Check http://en.m.wikipedia.org/wiki/Base64 more info

Here some screenshot running android in QPython Console shell. You can run this for your windows by downloading http://python.org, also comes in the bundle of every *nix and BSD OS out there.

pyb64.py


Source code:

0 comments:

Post a Comment