@@ 240-246 (lines=7) @@ | ||
237 | } |
|
238 | } |
|
239 | ||
240 | public function hash($type, $path, $raw = false) { |
|
241 | $fh = $this->fopen($path, 'rb'); |
|
242 | $ctx = \hash_init($type); |
|
243 | \hash_update_stream($ctx, $fh); |
|
244 | \fclose($fh); |
|
245 | return \hash_final($ctx, $raw); |
|
246 | } |
|
247 | ||
248 | public function search($query) { |
|
249 | return $this->searchInDir($query); |
@@ 861-867 (lines=7) @@ | ||
858 | * @param bool $raw |
|
859 | * @return string |
|
860 | */ |
|
861 | public function hash($type, $path, $raw = false) { |
|
862 | $fh = $this->fopen($path, 'rb'); |
|
863 | $ctx = \hash_init($type); |
|
864 | \hash_update_stream($ctx, $fh); |
|
865 | \fclose($fh); |
|
866 | return \hash_final($ctx, $raw); |
|
867 | } |
|
868 | ||
869 | /** |
|
870 | * return full path, including mount point |