0) { $read = hash_update_stream($ctx, $fp, min($chunkSize, $remaining)); //echo "$read\n"; $remaining -= $read; //printf("\r%04.1f%%",(1-$remaining/$length)*100); } //echo "\n"; return hash_final($ctx); } $hashes = parse_md5sum('sl-x86-3.4.loop1-to-3.4.loop2b.xd3.md5'); $fp = fopen('sl-x86-3.4.loop1-to-3.4.loop2b.xd3','rb'); $hash = hash_part($fp,0,40*1024*1024); echo "$hash\n"; if (isset($hashes[$hash])) { $file = $hashes[$hash]; echo "We have a match with file $file\n"; } fclose($fp); ?> Output: >php recover.php 40d99ed59fba1844207283d25f833c35 We have a match with file sl-x86-3.4.loop1-to-3.4.loop2b.xd3.00 >php recover.php 40d99ed59fba1844207283d25f833c35 We have a match with file sl-x86-3.4.loop1-to-3.4.loop2b.xd3.00 >php recover.php 40d99ed59fba1844207283d25f833c35 We have a match with file sl-x86-3.4.loop1-to-3.4.loop2b.xd3.00 >php recover.php 02621f7530933bab8dea50a61ff25003 >php recover.php 40d99ed59fba1844207283d25f833c35 We have a match with file sl-x86-3.4.loop1-to-3.4.loop2b.xd3.00