note 75440 added to function.crc32
| From: | mail at tristansmis dot nl | Date: | Wed, 30 May 2007 08:36:32 +0000 |
| Subject: | note 75440 added to function.crc32 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127014@lists.php.net to get a copy of this message | ||
I used the abs value of this function on a 32-bit system. When porting the code to a 64-bit system
Iâve found that the value is different. The following code has the same outcome on both
systems.
<?php
$crc = abs(crc32($string));
if( $crc & 0x80000000){
$crc ^= 0xffffffff;
$crc += 1;
}
/* Old solution
* $crc = abs(crc32($string))
*/
?>
----
Server IP: 83.137.20.120
Probable Submitter: 212.104.207.250
----
Manual Page -- http://www.php.net/manual/en/function.crc32.php
Edit -- https://master.php.net/note/edit/75440
Del: integrated -- https://master.php.net/note/delete/75440/integrated
Del: useless -- https://master.php.net/note/delete/75440/useless
Del: bad code -- https://master.php.net/note/delete/75440/bad+code
Del: spam -- https://master.php.net/note/delete/75440/spam
Del: non-english -- https://master.php.net/note/delete/75440/non-english
Del: in docs -- https://master.php.net/note/delete/75440/in+docs
Del: other reasons-- https://master.php.net/note/delete/75440
Reject -- https://master.php.net/note/reject/75440
Search -- https://master.php.net/manage/user-notes.php