src/Glacier/MultipartUploader.php
private function decorateWithHashes(Stream $stream, array &$data)
    {
        // Make sure that a tree hash is calculated.
        $stream = new HashingStream($stream, new TreeHash(),
            function ($result) use (&$data) {
                $data['checksum'] = bin2hex($result);
            }
        );

        // Make sure that a linear SHA256 hash is calculated.
        $stream = new HashingStream($stream, new PhpHash('sha256'),
            function ($result) use (&$data) {
                $data['ContentSHA256'] = bin2hex($result);
            }
        );

        return $stream;
    }
private function decorateWithHashes(Stream $stream, array &$data)
    {
        // Make sure that a tree hash is calculated.
        $stream = new HashingStream($stream, new TreeHash(),
            function ($result) use (&$data) {
                $data['checksum'] = bin2hex($result);
            }
        );

        // Make sure that a linear SHA256 hash is calculated.
        $stream = new HashingStream($stream, new PhpHash('sha256'),
            function ($result) use (&$data) {
                $data['ContentSHA256'] = bin2hex($result);
            }
        );

        return $stream;
    }
private function decorateWithHashes ( Stream $ stream , array & $ data ) { // Make sure that a tree hash is calculated. $ stream = new HashingStream ( $ stream , new TreeHash ( ) , function ( $ result ) use ( & $ data ) { $ data [ 'checksum' ] = bin2hex ( $ result ) ; } ) ; // Make sure that a linear SHA256 hash is calculated. $ stream = new HashingStream ( $ stream , new PhpHash ( 'sha256' ) , function ( $ result ) use ( & $ data ) { $ data [ 'ContentSHA256' ] = bin2hex ( $ result ) ; } ) ; return $ stream ; }
Decorates a stream with a tree AND linear sha256 hashing stream.

@param Stream $stream Stream to decorate.
@param array  $data   Data bag that results are injected into.

@return Stream
Decorates a stream with a tree AND linear sha256 hashing stream .