Are there any methods in JavaScript that could be used to encode and decode a string using base64 encoding?
In Gecko/WebKit-based browsers (Firefox, Chrome and Safari) and Opera, you can use btoa() and atob().
Original answer: How can you encode a string to Base64 in JavaScript?