ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\Util\StreamHasher Class Reference
+ Collaboration diagram for League\Flysystem\Util\StreamHasher:

Public Member Functions

 __construct ($algo)
 StreamHasher constructor. More...
 
 hash ($resource)
 

Private Attributes

 $algo
 

Detailed Description

Definition at line 5 of file StreamHasher.php.

Constructor & Destructor Documentation

◆ __construct()

League\Flysystem\Util\StreamHasher::__construct (   $algo)

StreamHasher constructor.

Parameters
string$algo

Definition at line 17 of file StreamHasher.php.

18 {
19 $this->algo = $algo;
20 }

References League\Flysystem\Util\StreamHasher\$algo.

Member Function Documentation

◆ hash()

League\Flysystem\Util\StreamHasher::hash (   $resource)
Parameters
$resource
Returns
string

Definition at line 27 of file StreamHasher.php.

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 }
$context
Definition: webdav.php:25

References $context.

Field Documentation

◆ $algo

League\Flysystem\Util\StreamHasher::$algo
private

Definition at line 10 of file StreamHasher.php.

Referenced by League\Flysystem\Util\StreamHasher\__construct().


The documentation for this class was generated from the following file: