ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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

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

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  }

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: