note 34139 added to function.crc32
| From: | xethmir at yournextclient dot com | Date: | Thu, 17 Jul 2003 00:12:49 +0000 |
| Subject: | note 34139 added to function.crc32 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52235@lists.php.net to get a copy of this message | ||
This is a really simple way of displaying the crc-32 hexadecimal code/checksum for a file...
(absolute paths are more reliable)
<?
$file = "http://foo.net/bar.jpg";
// Read the file into an array
$data = file($file);
// Join the array into a string
$data = implode('', $data);
// Calculate the crc
$crc = crc32($data);
//convert from decimal to hexadecimal
$crchex=DecHex($crc*1);
//echo the result
echo "$crchex";
?>
----
Manual Page -- http://www.php.net/manual/en/function.crc32.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34139
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34139&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34139&report=yes