Use the btoa() function to encode:
console.log(btoa("password")); // cGFzc3dvcmQ=
To decode, you can use the atob() function:
console.log(atob("cGFzc3dvcmQ=")); // password
Use the btoa() function to encode:
console.log(btoa("password")); // cGFzc3dvcmQ=
To decode, you can use the atob() function:
console.log(atob("cGFzc3dvcmQ=")); // password