Name: base64Encode

Type: function

Syntax: the base64Encode of <data> 

Syntax: base64Encode(<data>)

Summary: <return|Returns> a base 64- <encodedstring>.

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
write base64Encode(pictureFileData) to socket thisSocket

Parameters:
data (string): A string of binary data of any length.

Returns: The <base64Encode> function <return|returns> a text <string> representing the binary <data>.

Description:
Use the <base64Encode> function to <encode> <binary file|binary data> for transmission over communication channels that don't accept raw <binary file|binary data>.

The <base64Encode> function is the <inverse> of the <base64Decode> <function>. The <encode|encoded> result is generally about a third larger than the original data.
The encoded string returned by <base64Encode> <function> can include uppercase and lowercase letters, digits, +, /, and =, but no other characters. Base 64-encoded data is wrapped at 72 characters, so each <line> of the <encode|encoded> data is 72 <characters> or (for the last or only line) fewer.
The base 64 encoding scheme is often used to encode binary data for MIME mail and HTTP transfers.
For technical information about base 64 encoding, see section 6.8 of RFC 2045 at http://www.ietf.org/rfc/rfc2045.txt.

References: inverse (keyword), characters (keyword), line (keyword), string (keyword), numToChar (function), md5Digest (function), base64Decode (function), encode (glossary), binary file (glossary), encodedstring (glossary), return (glossary), function (control_st)

Tags: text processing
