From 90ddb46d522c37d2bc2eb68a6e0c9d52f9fbba42 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Mon, 26 Jan 2015 15:39:52 -0500 Subject: [PATCH] crypto: remove use of this._readableState Per #445 this removes a reference to this._readableState in hash._flush. It was used to get the encoding on the readable side to pass to the writable side but omitting it just causes the stream to handle the encoding issues. PR-URL: https://github.com/iojs/io.js/pull/610 Reviewed-By: Chris Dickinson Reviewed-By: Fedor Indutny Reviewed-By: Vladimir Kurchatkin --- lib/crypto.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/crypto.js b/lib/crypto.js index 2d08433..f8efffd 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -86,8 +86,7 @@ Hash.prototype._transform = function(chunk, encoding, callback) { }; Hash.prototype._flush = function(callback) { - var encoding = this._readableState.encoding || 'buffer'; - this.push(this._handle.digest(encoding), encoding); + this.push(this._handle.digest()); callback(); }; -- 2.7.4