Created
June 25, 2015 20:26
-
-
Save spite/952643a464583adc25b1 to your computer and use it in GitHub Desktop.
Base64 encode/decode UTF-8
This file contains hidden or 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
function b64EncodeUnicode(str) { | |
return btoa( unescape( encodeURIComponent( str ) ) ); | |
} | |
function b64DecodeUnicode(str) { | |
return decodeURIComponent( escape( atob( str ) ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment