All pastes #559433 Raw Edit

Someone

public php v1 · immutable
·published 2007-06-11 19:30 UTC
rendered paste body
<?phpfunction hash_part($fp,$start,$length) {	$ctx = hash_init('md5');	$remaining=$length;	$chunkSize=65536;	while ($remaining > 0) {		$read = hash_update_stream($ctx, $fp, $chunkSize);		if($read != $chunkSize) {			echo "Unexpected read value $read, when we had $remaining bytes left\n";			echo "We ".(feof($fp)?'ARE':'are NOT')." in EOF\n";		}		$remaining -= $read;		//printf("\r%04.1f%%",(1-$remaining/$length)*100);	}	//echo "\n";	return hash_final($ctx);}//$fp = fopen('sl-x86-3.4.loop1-to-3.4.loop2b.xd3','rb');$fp = fopen('../../directx_aug2006_redist.exe','rb');$hash = hash_part($fp,0,40*1024*1024);echo "$hash\n";if ($hash != "64468f8a359ab1dfcb770c2f81d60fd0") {	echo "WHAT THE HELL IS GOING ON\n";}fclose($fp);?>Output on ten runs:68d6029b53aa809b7668b08f2052addfWHAT THE HELL IS GOING ON64468f8a359ab1dfcb770c2f81d60fd0597403d419936ef0f425b7cf30303e28WHAT THE HELL IS GOING ON64468f8a359ab1dfcb770c2f81d60fd064468f8a359ab1dfcb770c2f81d60fd064468f8a359ab1dfcb770c2f81d60fd064468f8a359ab1dfcb770c2f81d60fd064468f8a359ab1dfcb770c2f81d60fd004b48a6570d4bb3d39c2c8f32de36bcaWHAT THE HELL IS GOING ON64468f8a359ab1dfcb770c2f81d60fd0