Encode a string value as Base64. Text containing characters above U+00FF is encoded as the UTF-8 byte order mark followed by its UTF-8 bytes, so it can be restored by the matching decode function. All other text is encoded as one byte per character.
U+00FF
The string value to encode
The Base64 encoded string
0.13.0
encodeAsBase64("Hello"); // "SGVsbG8="encodeAsBase64("Hello World"); // "SGVsbG8gV29ybGQ="encodeAsBase64(""); // ""encodeAsBase64("€"); // "77u/4oKs" Copy
encodeAsBase64("Hello"); // "SGVsbG8="encodeAsBase64("Hello World"); // "SGVsbG8gV29ybGQ="encodeAsBase64(""); // ""encodeAsBase64("€"); // "77u/4oKs"
Encode a string value as Base64. Text containing characters above
U+00FFis encoded as the UTF-8 byte order mark followed by its UTF-8 bytes, so it can be restored by the matching decode function. All other text is encoded as one byte per character.