note 36582 added to function.crc32

From: Date: Wed, 15 Oct 2003 14:08:02 +0000
Subject: note 36582 added to function.crc32
Groups: php.notes 
Request: Send a blank email to php-notes+get-58633@lists.php.net to get a copy of this message
This function returns the unsigned crc32 value. I realized it's not very obvious from the current documentation. /** * Function to compute the unsigned crc32 value. * PHP crc32 function returns int which is signed, so in order to get the correct crc32 value * we need to convert it to unsigned value. * * @param $str - String to compute the unsigned crc32 value. * @return $var - Unsinged inter value. */ function computeUnsignedCRC32($str){ sscanf(crc32($str), "%u", $var); return $var; } ---- Manual Page -- http://www.php.net/manual/en/function.crc32.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36582 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36582&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36582&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58633) next »