ToBase64()

Calculates the Base64 representation of a string or binary object.

The Base64 format uses printable characters, allowing binary data to be sent in forms and e-mail, and stored in a database or file.

ToBase64( strOrBin=any, encoding=string );

Returns: String

Argument Description
strOrBin
any, required

A string, the name of a string, or a binary object.

Alias: string, BinaryData

encoding
string, optional

For a string, defines how characters are represented in a byte array.

Examples

dump(ToBase64("ToBase64")); // VG9CYXNlNjQ=

See also