The function converts the characters to bytes as if they were ASCII encoded.
Convert the data to an ArrayBuffer first if you need to convert strings with
characters outside the ASCII alphabet.
Parameters
input: string|ArrayBuffer|Uint8Array
Returns string
a string with base64-encoded data
Throws
Error if the input string contains a character outside of ASCII
Encode a string or a byte buffer into base64.
The function converts the characters to bytes as if they were ASCII encoded. Convert the data to an ArrayBuffer first if you need to convert strings with characters outside the ASCII alphabet.