Previous - aesDecryptString Section Home - Rosetta Xtra Function Categories Next - b64encode


Rosetta Xtra - Base64 Functions

Much of the web uses plain text. Email and html are two examples of pure plain text usage. By pure plain text, we mean alphabets, and numbers. Mail servers, for example, typically supports only 7 bit strings, so it can read plain text but not binary. To solve the problem of sending binary files such as a JPEG image or videos through mail servers, base64 is used to convert ASCII strings down to plain text strings. This technique is described in RFC 1521 MIME ( Multipurpose Internet Mail Extensions).

Base64 uses 6 bits to encode all strings The character set for base 64 are 0 to 9, A to Z, a-z, and the characters '+" and '/". Since only 64 characters are supported in base 64, the algorithm is to convert between 3 characters of 8 bits each to 4 characters of 6 bits each.

When Base64 is paired with Rosetta's file IO functions, developers can read and write files to support the MIME standard. This can be useful to create, send, and extract email.

Method summary for Base64 Conversion

Method

b64encode()
b64decode()

Previous - aesDecryptString Section Home - Rosetta Xtra Function Categories Next - b64encode