- hash: documentation ( source)
- hexdec: documentation ( source)
- pow: documentation ( source)
<?php
function __int32($numeric_value){
$x = (float)$numeric_value;
$y = pow(2,32);
if ($x > $y) {
$x = pow(2,31)-1;
} elseif ($x >= pow(2,31)) {
$x -= $y;
}
return (int)$x;
}
function crc32int($string) {
return __int32(hexdec(hash("crc32b", $string)));
}
echo crc32int('http://evil.com');