I'm having an issue trying to figure out why in javascript.
1532515508 ^ -3955803181 = 1332703079
but in php it equals...
1532515508 ^ -3955803181 = -614968140
Does anybody know why?
I'm having an issue trying to figure out why in javascript.
1532515508 ^ -3955803181 = 1332703079
but in php it equals...
1532515508 ^ -3955803181 = -614968140
Does anybody know why?
It depends on the number of bits used to represent those values. If they are using a different number of bits, you will get different results.
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Never mind... JavaScript was using unsigned integers while Php was using Signed...
At least I think that's what was happening... This fixed it...
_unSign(1532515508) ^ _unSign(-3955803181) = 1332703079Code:function _unSign($i1) { if(0x7fffffff < $i1) { $i1 -= 0xffffffff + 1.0; }elseif (-0x80000000 > $i1) { $i1 += 0xffffffff + 1.0; } return $i1; }
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum