Help needed with hexdec();

From: Date: Sat, 06 Jul 2002 21:54:23 +0000
Subject: Help needed with hexdec();
Groups: php.general 
Request: Send a blank email to php-general+get-105881@lists.php.net to get a copy of this message
Hi Guys, I have a problem wich I hope has been solved by someone :-) Here's the deal, I have to convert a perl script to PHP trying to do so I get negative values from hexdec(), If I use (int)hexdec() the numbers aren't negative anymore, but they do not add up to what they should. Here's the perl line: $a = FF ($a, $b, $c, $d, $temparr[8], $S11, hex("698098d8")); this is PHP: $a = FF ($a, $b, $c, $d, $temparr[8], $S11, hexdec("698098d8")); FF is a function: function FF($a,$b,$c,$d,$x,$s,$ac) { $a += F($b,$c,$d) + $x + $ac; if ($a > hexdec("ffffffff")) { $a = substr($a,strlen($a)-9,9) ; } $a = RL($a,$s); $a += $b; return $a; } F is also a function: function F($x, $y, $z) { return ((($x) & ($y)) | ((~$x) & ($z))); } Could anybody tell me what I am missing here? e-mail: <mailto:frank@hertogs.info> frank@hertogs.info

« previous php.general (#105881) next »