Skip to content

Instantly share code, notes, and snippets.

@genert
Created July 9, 2015 10:46
Show Gist options
  • Save genert/9dd32f0c9fa2fbb2e827 to your computer and use it in GitHub Desktop.
Save genert/9dd32f0c9fa2fbb2e827 to your computer and use it in GitHub Desktop.
Codwars Node Base64 Challange Javascript Solution
String.prototype.toBase64 = function() {
return new Buffer(this.toString()).toString('base64');
};
String.prototype.fromBase64 = function() {
return new Buffer(this.toString(), 'base64').toString('utf8');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment