Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created November 27, 2010 23:38
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save indexzero/718390 to your computer and use it in GitHub Desktop.
Save indexzero/718390 to your computer and use it in GitHub Desktop.
An extremely simple implementation of base64 encoding / decoding using node.js Buffers
//
// Super simple base64 encoding / decoding with node.js
//
var base64 = exports = {
encode: function (unencoded) {
return new Buffer(unencoded).toString('base64');
},
decode: function (encoded) {
return new Buffer(encoded, 'base64').toString('utf8');
}
};
@rostag
Copy link

rostag commented Jan 30, 2017

@budiony — thanks, saved me a lot of nerves =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment