Skip to content

Instantly share code, notes, and snippets.

@kriscooke
Forked from jmshal/atob.js
Created June 18, 2020 04:46
Show Gist options
  • Save kriscooke/ee44e99acce9967437e62e9a1c26b2a2 to your computer and use it in GitHub Desktop.
Save kriscooke/ee44e99acce9967437e62e9a1c26b2a2 to your computer and use it in GitHub Desktop.

Revisions

  1. @jmshal jmshal revised this gist Oct 12, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion atob.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    module.exports = function atob(a) {
    return new Buffer(a, 'base64').toString('utf8');
    return new Buffer(a, 'base64').toString('binary');
    };
  2. @jmshal jmshal created this gist Oct 12, 2016.
    3 changes: 3 additions & 0 deletions atob.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    module.exports = function atob(a) {
    return new Buffer(a, 'base64').toString('utf8');
    };
    3 changes: 3 additions & 0 deletions btoa.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    module.exports = function btoa(b) {
    return new Buffer(b).toString('base64');
    };
    4 changes: 4 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    module.exports = {
    atob: require('./atob'),
    btoa: require('./btoa'),
    };
    5 changes: 5 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    {
    "name": "atob-btoa.js",
    "version": "1.0.0",
    "description": "Node.js ponyfill for atob and btoa encoding functions"
    }