Skip to content

Instantly share code, notes, and snippets.

@xypaul
Forked from Marak/base64.js
Created January 10, 2014 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xypaul/8347175 to your computer and use it in GitHub Desktop.
Save xypaul/8347175 to your computer and use it in GitHub Desktop.
/*
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
*
* (C) 2010, Nodejitsu Inc.
*
*/
var base64 = exports;
base64.encode = function (unencoded) {
return new Buffer(unencoded || '').toString('base64');
};
base64.decode = function (encoded) {
return new Buffer(encoded || '', 'base64').toString('utf8');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment