Created
July 9, 2015 10:46
-
-
Save genert/9dd32f0c9fa2fbb2e827 to your computer and use it in GitHub Desktop.
Codwars Node Base64 Challange Javascript Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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