Skip to content

Commit

Permalink
crypto: remove use of this._readableState
Browse files Browse the repository at this point in the history
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: #610
Reviewed-By: Chris Dickinson <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Vladimir Kurchatkin <[email protected]>
  • Loading branch information
calvinmetcalf authored and vkurchatkin committed Jan 28, 2015
1 parent 45d8d9f commit 90ddb46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

Expand Down

0 comments on commit 90ddb46

Please sign in to comment.