<?php
$hash = hash('sha256', 'The quick brown fox jumped over the lazy dog.');
$ctx = hash_init('sha256');
hash_update($ctx, 'The quick brown fox ');
hash_update($ctx, 'jumped over the lazy dog.');
$incremental_hash = hash_final($ctx);
echo $incremental_hash, PHP_EOL;
var_dump($hash === $incremental_hash);
?>
The above example will output:
68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483
bool(true)