base64Encode

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the base64Encode of <data>
base64Encode(<data>)
Summary

Returns a base 64-encoded string.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
data

A string of binary data of any length.

Example
write base64Encode(pictureFileData) to socket thisSocket
Values
NameTypeDescription
return

The base64Encode function returns a text string representing the binary data.

RelatedKeyword: inverse, characters, line, string
Function: numToChar, md5Digest, base64Decode
Glossary: encode, binary file, return
Control Structure: function
Description

Use the base64Encode function to encode binary data for transmission over communication channels that don't accept raw binary data.

The base64Encode function is the inverse of the base64Decode function. The 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 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 RFC 2045, section 6.8.

Tagstext processing