encodeBase64

Encodes Base64 content. Traditionally, JavaScript would use btoa to encode binary data to Base64, but the function does not exist in Sentinel JavaScripts because there is no window object.

Signatures

beacon.encodeBase64(binary);

Parameters

binary

The raw binary content to encode.

Return Values

Type Notes
String The encoded ASCII-safe data.

Examples

Encode a hello world message

const encoded = beacon.encodeBase64('Hello World');
beacon.debugPrint(encoded); // Outputs "SGVsbG8gV29ybGQ="

See Also