I hate when this happens.... all I needed was dechex(). *sigh*
I could have sworn I'd tried that already, ah well.
Jason Barnett wrote:
I've been able to use md5 / md5_file to verify file integrity. However
when I try to check crc32's I'm running into some problems. As an
example I download and extract the PHP package for Windows, then when I
try to crc32() the file contents I get a totally different value from
what I think I should be getting. Obviously I'm missing out on some
crucial detail(s) here...
<?php
echo '<pre>';
// This is the extracted install.txt from PHP-5.0.1.Win32.zip
$file = 'C:\Downloads\install.txt';
// crc for the file - got from my unzip utility
echo $crc = 'EEED9D44' . "\n";
// reading all at once - buffer added line by line produced same results
$contents = file_get_contents($file);
printf ("%u\n", crc32($contents));
// result: 4008549700
// by the way, how can we cast to unsigned integer instead of using printf?
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php