Class TreeHash
- Aws\Glacier\TreeHash implements Aws\HashInterface
- Namespace: Aws\Glacier
- Located at Glacier/TreeHash.php
Encapsulates the creation of a tree hash from streamed data
Methods Summary
- __construct ( $algorithm = 'sha256' )
-
update ( string $data )
Adds data to the hash.
-
addChecksum ( string $checksum, bool $inBinaryForm = false )
Add a checksum to the tree hash directly
-
complete ( )
Finalizes the incremental hash and returns the resulting digest.
-
reset ( )
Removes all data from the hash, effectively starting a new hash.
Methods Details
__construct ( $algorithm = 'sha256' )
update ( string $data )
Adds data to the hash.
Parameters
string | $data | Data to add to the hash |
Exceptions
LogicException if the root tree hash is already calculated |
Implementation of
Aws\Glacier\TreeHash
addChecksum (
string
$checksum,
boolean
$inBinaryForm = false
)
Add a checksum to the tree hash directly
Parameters
string | $checksum | The checksum to add |
boolean | $inBinaryForm = false | TRUE if checksum is in binary form |
Returns
Aws\Glacier\TreeHash |
Exceptions
LogicException if the root tree hash is already calculated |
string complete ( )
Finalizes the incremental hash and returns the resulting digest.
Returns
string |
Implementation of
reset ( )
Removes all data from the hash, effectively starting a new hash.
Implementation of
Constants summary
integer |
MB
|
#
1048576
|
string |
EMPTY_HASH
|
#
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
|