note 31408 modified in function.crc32 by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:55:51 +0000 |
| Subject: | note 31408 modified in function.crc32 by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79776@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 ;)
<?php
function generate_sfv_checksum($filename) {
$sfv_checksum = strtoupper(dechex(crc32(file_get_contents($filename))));
return $sfv_checksum;
}
?>
--was--
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://php.net/manual/en/function.crc32.php