note 31408 added to function.crc32
| From: | lander at liebe dot nu | Date: | Mon, 21 Apr 2003 00:22:45 +0000 |
| Subject: | note 31408 added to function.crc32 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46864@lists.php.net to get a copy of this message | ||
A simple and quite fast (10ms/Mb) way to generate checksums used with the popular SFV (Simple File
Verification) format. strtoupper() isn't really needed, but the output looks better this way ;)
function generate_sfv_checksum($filename) {
$sfv_checksum = strtoupper(dechex(crc32(file_get_contents($filename))));
return $sfv_checksum;
}
--
http://www.php.net/manual/en/function.crc32.php
http://master.php.net/manage/user-notes.php?action=edit+31408
http://master.php.net/manage/user-notes.php?action=delete+31408
http://master.php.net/manage/user-notes.php?action=reject+31408