These functions are to used encode and decode the base64. These functions are available in window object.
btoa() - It creates a base64 encoded string
atob() - decodes a base64
const encodedData = window.btoa('Hello, world'); // encode a string
const decodedData = window.atob(encodedData); // decode the string