ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StreamHasher.php
Go to the documentation of this file.
1<?php
2
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}
An exception for terminatinating execution or to throw for unit testing.
__construct($algo)
StreamHasher constructor.
$context
Definition: webdav.php:25