diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-07-23 13:52:44 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-07-23 13:52:44 -0700 |
commit | 528015e0d84063891f7fbbc7d5bde3a2a38d8b0d (patch) | |
tree | a8a0e750786a173b772c78163ce64445c0418638 /lib | |
parent | 138593b156c20b17429aeb1ab3f1da2c3b5b7892 (diff) | |
download | node-new-528015e0d84063891f7fbbc7d5bde3a2a38d8b0d.tar.gz |
Implement buffer.toString('base64')
Diffstat (limited to 'lib')
-rw-r--r-- | lib/buffer.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/buffer.js b/lib/buffer.js index ef46482151..e58a34b67e 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -42,6 +42,9 @@ Buffer.prototype.toString = function (encoding, start, stop) { case 'binary': return this.binarySlice(start, stop); + case 'base64': + return this.base64Slice(start, stop); + default: throw new Error('Unknown encoding'); } |