Created
April 22, 2019 14:35
-
-
Save akhileshdarjee/4e1e2ace2011f3fa643622e8581361a0 to your computer and use it in GitHub Desktop.
Convert any string to base64 string in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "Hello World!"; | |
var base64_str = window.btoa(str); | |
// or | |
var base64_str = btoa(str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment