btoa

function

function btoa(s: string): string

Creates a base-64 ASCII encoded string from the input string.

console.log(btoa("hello world"));  // outputs "aGVsbG8gd29ybGQ="