Base64 encoding

Syntax

$input.base64Encode()

Description

Encodes the passed binary data using the Base64 encoding scheme and returns the result as a string.

Parameters

Name Type Description Mandatory Default
input Binary data The binary data to be encoded yes -
mime Truth value Whether MIME-compatible encoding should take place no false

Return value

type: string

Example

binary(name: "file.txt", data: "Mein Text", encoding: "utf-8").base64Encode()

Returns the Base64 encoding of "My Text" in UTF-8 character set: "TWVpbiBUZXh0".