Convert a string to base64

March - 2022
var encodedData = btoa(stringToEncode);

https://developer.mozilla.org/en-US/docs/Web/API/btoa