note 117712 deleted from function.crc32 by cmb
| From: | cmb@php.net | Date: | Tue, 25 Aug 2015 01:31:38 +0000 |
| Subject: | note 117712 deleted from function.crc32 by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203463@lists.php.net to get a copy of this message | ||
Note Submitter: Joey
----
The manual is misleading.
> hash("crc32b", $str) will return the same string as dechex(crc32($str)).
hash("crc32b", $str) will **NOT** return the same string as dechex(crc32($str)).
Source: '9818479'
string(7) "d009e37"
string(8) "0d009e37"
Using the hash function is more portable and recommended.
hash("crc32b", $str) will return the same string as:
str_pad(dechex(crc32($str)), 8, '0', STR_PAD_LEFT)