note 113079 deleted from function.crc32 by peehaa

From: Date: Thu, 29 Aug 2013 10:18:15 +0000
Subject: note 113079 deleted from function.crc32 by peehaa
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-196116@lists.php.net to get a copy of this message
Note Submitter: rasmus at mindplay dot dk ---- Your best bet for consistent behavior across 32/64-bit platforms (and Windows) is the lowest common denominator: force the return value of crc32() into a signed 32-bit integer, e.g.: var_dump(unpack('l', pack('l', crc32('123456789_00_0')))); This looks idiotic, but it gives you a consistent signed integer value on all platforms. (that's a lower-case "L" for both arguments, if that happens looks like the number "1" on your screen.)

« previous php.notes (#196116) next »