ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
StreamHasher.php
Go to the documentation of this file.
1 <?php
2 
3 namespace League\Flysystem\Util;
4 
6 {
10  private $algo;
11 
17  public function __construct($algo)
18  {
19  $this->algo = $algo;
20  }
21 
27  public function hash($resource)
28  {
29  rewind($resource);
30  $context = hash_init($this->algo);
31  hash_update_stream($context, $resource);
32  fclose($resource);
33 
34  return hash_final($context);
35  }
36 }
__construct($algo)
StreamHasher constructor.