How to encode and decode string with base64 in TypeScript

1 Answer

0 votes
let s = "typescript";
 
let encode = btoa(s);
console.log(encode); 
 
let decode = atob(encode);
console.log(decode); 
 
 
   
     
     
/*
run:
 
"dHlwZXNjcmlwdA==" 
"typescript" 
     
*/

 



answered Jan 23, 2022 by avibootz

Related questions

...