Skip to content

Commit

Permalink
Updated hash before emitting data, this keeps the data from $data in …
Browse files Browse the repository at this point in the history
…memory a wee bit shorter
  • Loading branch information
WyriHaximus committed Jul 7, 2017
1 parent 51630e2 commit 80e1a20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ReadableStreamHash.php
Expand Up @@ -28,8 +28,8 @@ public function __construct(ReadableStreamInterface $stream, string $hash, int $
$this->stream = $stream;
$this->context = hash_init($hash, $options, $key);
$this->stream->on('data', function ($data) {
$this->emit('data', [$data]);
hash_update($this->context, $data);
$this->emit('data', [$data]);
});
$this->stream->once('close', function () {
$this->emit('close');
Expand Down

0 comments on commit 80e1a20

Please sign in to comment.