mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-28 07:09:01 +00:00
BigInteger: fix getLength()
This commit is contained in:
parent
e32531001b
commit
c55b75199e
@ -762,7 +762,7 @@ class Math_BigInteger
|
|||||||
|
|
||||||
$max = count($this->value) - 1;
|
$max = count($this->value) - 1;
|
||||||
return $max != -1 ?
|
return $max != -1 ?
|
||||||
$max * MATH_BIGINTEGER_BASE + ceil(log($a->value[$max] + 1, 2)) :
|
$max * MATH_BIGINTEGER_BASE + intval(ceil(log($this->value[$max] + 1, 2))) :
|
||||||
0;
|
0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,7 +773,7 @@ class Math_BigInteger
|
|||||||
*/
|
*/
|
||||||
function getLengthInBytes()
|
function getLengthInBytes()
|
||||||
{
|
{
|
||||||
return ceil($this->getLength() / 8);
|
return (int) ceil($this->getLength() / 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user