Skip to content

Instantly share code, notes, and snippets.

@posquit0
Last active August 21, 2017 09:47
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 posquit0/8188c52d0ba03ad4419278a936163134 to your computer and use it in GitHub Desktop.
Save posquit0/8188c52d0ba03ad4419278a936163134 to your computer and use it in GitHub Desktop.
Node.js base64
/*
* base64.js
*/
const base64 = {
encode: (plain) => {
return Buffer.from(plain || '').toString('base64');
},
decode: (encoded) => {
return Buffer.from(encoded || '', 'base64').toString('ascii');
}
};
module.exports = base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment