Advertisement
Guest User

crc32 php fix

a guest
Feb 14th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public static function signed_crc32($)
  2. {
  3. $hash = crc32($text);
  4.  
  5. if ($hash & 0x80000000)
  6. {
  7. $hash ^= 0xffffffff;
  8. $hash += 1;
  9. $hash = -$hash;
  10. }
  11.  
  12. return $hash;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement