How to use incremental hashing and add text file content into an active hashing in PHP

1 Answer

0 votes
$fp = tmpfile();
fwrite($fp, 'hashing algorithm: md5, sha256');
rewind($fp);

$hi = hash_init('md5');
hash_update_stream($hi, $fp);
echo hash_final($hi);


/*
run:

44b01fa87531e214c4be66d5d3845e05

*/

 



answered Jun 27, 2016 by avibootz
...