note 97756 added to function.hexdec
| From: | Rosberg-rosberglinhares at gmail dot com | Date: | Thu, 06 May 2010 15:45:11 +0000 |
| Subject: | note 97756 added to function.hexdec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169014@lists.php.net to get a copy of this message | ||
The correct version is:
function bchexdec($hex) {
static $hexdec = array(
"0" => 0,
"1" => 1,
"2" => 2,
"3" => 3,
"4" => 4,
"5" => 5,
"6" => 6,
"7" => 7,
"8" => 8,
"9" => 9,
"A" => 10,
"B" => 11,
"C" => 12,
"D" => 13,
"E" => 14,
"F" => 15
);
$dec = 0;
for ($i = strlen($hex) - 1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) {
$factor = $hexdec[$hex[$i]];
$dec = bcadd($dec, bcmul($factor, $e));
}
return $dec;
}
----
Server IP: 69.147.83.197
Probable Submitter: 189.71.127.71
----
Manual Page -- http://www.php.net/manual/en/function.hexdec.php
Edit -- https://master.php.net/note/edit/97756
Del: integrated -- https://master.php.net/note/delete/97756/integrated
Del: useless -- https://master.php.net/note/delete/97756/useless
Del: bad code -- https://master.php.net/note/delete/97756/bad+code
Del: spam -- https://master.php.net/note/delete/97756/spam
Del: non-english -- https://master.php.net/note/delete/97756/non-english
Del: in docs -- https://master.php.net/note/delete/97756/in+docs
Del: other reasons-- https://master.php.net/note/delete/97756
Reject -- https://master.php.net/note/reject/97756
Search -- https://master.php.net/manage/user-notes.php