NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Interface ChunkHashInterface

Interface for objects that encapsulate the creation of a hash from streamed chunks of data

### Direct known implementers

`Aws\Common\Hash\ChunkHash`, `Aws\Common\Hash\TreeHash`

Namespace: Aws\Common\Hash
Located at Aws/Common/Hash/ChunkHashInterface.php

## 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

# `public `Aws\Common\Hash\ChunkHashInterface``
`__construct( string $algorithm = 'sha256' )`

Constructs the chunk hash and sets the algorithm to use for hashing

#### Parameters

$algorithm
  `string`
  $algorithm A valid hash algorithm name as returned by `hash_algos()`

#### Returns

``Aws\Common\Hash\ChunkHashInterface``
# `public `Aws\Common\Hash\ChunkHashInterface``
`addData( string $data )`

Add a chunk of data to be hashed

#### Parameters

$data
  `string`
  $data Data to be hashed

#### Returns

``Aws\Common\Hash\ChunkHashInterface``
# `public string`
`getHash( boolean $returnBinaryForm = false )`

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'` | #