Browse Source

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 <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
v1.8.0-commit
Calvin Metcalf 10 years ago
committed by Vladimir Kurchatkin
parent
commit
90ddb46d52
  1. 3
      lib/crypto.js

3
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();
};

Loading…
Cancel
Save