Created
April 8, 2015 23:01
-
-
Save leosuncin/1a50bce9cd3aa4a893c0 to your computer and use it in GitHub Desktop.
Node.js Base64 functions
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 btoa (str) { | |
return new Buffer(str).toString('base64'); | |
} | |
function atob(str) { | |
return new Buffer(str, 'base64').toString('binary'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment