Interface ChunkHashInterface
Interface for objects that encapsulate the creation of a hash from streamed chunks of data
Direct known implementers
Methods summary
-
public
__construct ( string $algorithm = 'sha256' )
Constructs the chunk hash and sets the algorithm to use for hashing
-
public
addData ( string $data )
Add a chunk of data to be hashed
-
public
getHash ( bool $returnBinaryForm = false )
Return the results of the hash
Methods detail
Constructs the chunk hash and sets the algorithm to use for hashing
Parameters
- $algorithm
string
$algorithm A valid hash algorithm name as returned byhash_algos()
Returns
Add a chunk of data to be hashed
Parameters
- $data
string
$data Data to be hashed
Returns
Return the results of the hash
Parameters
- $returnBinaryForm
boolean
$returnBinaryForm If true, returns the hash in binary form instead of hex form
Returns
string
Magic methods summary
Constants summary
string |
DEFAULT_ALGORITHM |
'sha256' |