| @@ 40-55 (lines=16) @@ | ||
| 37 | hash_update($this->context, $data);  | 
                                |
| 38 |             $this->emit('data', [$data]); | 
                                |
| 39 | });  | 
                                |
| 40 |         $this->stream->once('close', function () use ($algo) { | 
                                |
| 41 |             $this->emit('close'); | 
                                |
| 42 | $hash = hash_final($this->context, true);  | 
                                |
| 43 |             if (count($this->listeners('hash')) > 0) { | 
                                |
| 44 |                 $this->emit('hash', [ | 
                                |
| 45 | bin2hex($hash),  | 
                                |
| 46 | $algo,  | 
                                |
| 47 | ]);  | 
                                |
| 48 | }  | 
                                |
| 49 |             if (count($this->listeners('hash_raw')) > 0) { | 
                                |
| 50 |                 $this->emit('hash_raw', [ | 
                                |
| 51 | $hash,  | 
                                |
| 52 | $algo,  | 
                                |
| 53 | ]);  | 
                                |
| 54 | }  | 
                                |
| 55 | });  | 
                                |
| 56 | Util::forwardEvents($stream, $this, ['error', 'end']);  | 
                                |
| 57 | }  | 
                                |
| 58 | ||
| @@ 35-49 (lines=15) @@ | ||
| 32 | $options[] = $key;  | 
                                |
| 33 | }  | 
                                |
| 34 | $this->context = hash_init(...$options);  | 
                                |
| 35 |         $this->stream->once('close', function () use ($algo) { | 
                                |
| 36 | $hash = hash_final($this->context, true);  | 
                                |
| 37 |             if (count($this->listeners('hash')) > 0) { | 
                                |
| 38 |                 $this->emit('hash', [ | 
                                |
| 39 | bin2hex($hash),  | 
                                |
| 40 | $algo,  | 
                                |
| 41 | ]);  | 
                                |
| 42 | }  | 
                                |
| 43 |             if (count($this->listeners('hash_raw')) > 0) { | 
                                |
| 44 |                 $this->emit('hash_raw', [ | 
                                |
| 45 | $hash,  | 
                                |
| 46 | $algo,  | 
                                |
| 47 | ]);  | 
                                |
| 48 | }  | 
                                |
| 49 | });  | 
                                |
| 50 | }  | 
                                |
| 51 | ||
| 52 | public function isWritable()  | 
                                |