summaryrefslogtreecommitdiff
path: root/lib/crypto.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-03 19:14:06 -0800
committerisaacs <i@izs.me>2013-03-05 14:27:15 -0800
commit426b4c625802c7b6913fa09237aa9745bf3ae84a (patch)
tree81756bcb6720145decb01160df08b5315784657b /lib/crypto.js
parentcd68d86c3283af2f4b3c349c2081c609e3978b9b (diff)
downloadnodejs-426b4c625802c7b6913fa09237aa9745bf3ae84a.tar.gz
nodejs-426b4c625802c7b6913fa09237aa9745bf3ae84a.tar.bz2
nodejs-426b4c625802c7b6913fa09237aa9745bf3ae84a.zip
stream: _write takes an encoding argument
This vastly reduces the overhead of decodeStrings:false streams, such as net and http.
Diffstat (limited to 'lib/crypto.js')
-rw-r--r--lib/crypto.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/crypto.js b/lib/crypto.js
index 500e14d2f..01d4b7125 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -160,8 +160,8 @@ function Hash(algorithm, options) {
util.inherits(Hash, stream.Transform);
-Hash.prototype._transform = function(chunk, callback) {
- this._binding.update(chunk);
+Hash.prototype._transform = function(chunk, encoding, callback) {
+ this._binding.update(chunk, encoding);
callback();
};
@@ -226,8 +226,8 @@ function Cipher(cipher, password, options) {
util.inherits(Cipher, stream.Transform);
-Cipher.prototype._transform = function(chunk, callback) {
- this.push(this._binding.update(chunk));
+Cipher.prototype._transform = function(chunk, encoding, callback) {
+ this.push(this._binding.update(chunk, encoding));
callback();
};
@@ -351,8 +351,8 @@ function Sign(algorithm, options) {
util.inherits(Sign, stream.Writable);
-Sign.prototype._write = function(chunk, callback) {
- this._binding.update(chunk);
+Sign.prototype._write = function(chunk, encoding, callback) {
+ this._binding.update(chunk, encoding);
callback();
};