Skip to main content
Version: Next

BASE64 ENCODE

BASE64 ENCODE ( toEncode {; encoded}{; *} )

ParameterTypeDescription
toEncodeBlob, TextValue to encode
Encoded value (if encoded parameter omitted)
encodedBlob, TextEncoded value
*OperatorEncode in Base64URL format

Description

The BASE64 ENCODE command encodes the text or blob value passed in the toEncode parameter in Base64 or Base64URL format.

Base64 encoding modifies 8-bit coded data so that they do not keep more than 7 useful bits. This encoding is required, for example, for handling blobs using xml. Base64URL is an alernative encoding with a specific processing for URLs and filenames (see rfc4648).

Pass in toEncode a text or blob value to encode.

Note: When you pass a text value, the command encodes the utf-8 representation of the text.

If you pass the encoded parameter, it receives the encoded contents of toEncode as text or blob at the end of command execution. In this case, the toEncode parameter itself is not modified by the command.

If you omit the encoded parameter, the command directly modifies the toEncode parameter.

By default if the * parameter is omitted, the command uses a Base64 encoding. If you pass the * parameter, the command uses a Base64URL encoding.

See also

BASE64 DECODE
Generate digest
Overview of XML DOM Commands
XML DECODE