-
-
Save lancevo/d13510337da44bd75ca9074b1b000d90 to your computer and use it in GitHub Desktop.
Node.js ponyfill for atob and btoa encoding 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
module.exports = function atob(a) { | |
return new Buffer(a, 'base64').toString('binary'); | |
}; |
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
module.exports = function btoa(b) { | |
return new Buffer(b).toString('base64'); | |
}; |
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
module.exports = { | |
atob: require('./atob'), | |
btoa: require('./btoa'), | |
}; |
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
{ | |
"name": "atob-btoa.js", | |
"version": "1.0.0", | |
"description": "Node.js ponyfill for atob and btoa encoding functions" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment