From 20e6d19d85473b051f293ffe4272af0e9d26cec5 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Fri, 15 Feb 2013 20:11:40 +0100 Subject: [PATCH] Added GMP base --- src/utils/Utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 255fc83ed..7828ec455 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -526,10 +526,10 @@ class Utils extends Thread{ } public static function readLong($str){ - $n = gmp_init(Utils::strToHex($str)); - if(gmp_testbit($n, 63)){ + $n = gmp_init(Utils::strToHex($str), 16); + if(gmp_testbit($n, "63")){ $n = gmp_xor($n, "0xffffffffffffffff"); //flip the bits - $n = gmp_neg(gmp_add($n, 1)); // add one and negate + $n = gmp_neg(gmp_add($n, "1")); // add one and negate } return gmp_strval($n); }