mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-22 05:51:20 +01:00
Merge branch '2.0'
This commit is contained in:
commit
ab270d1602
@ -206,7 +206,7 @@ abstract class Engine implements \Serializable
|
||||
$temp = $comparison < 0 ? $this->add(new static(1)) : $this;
|
||||
$bytes = $temp->toBytes();
|
||||
|
||||
if (empty($bytes)) { // eg. if the number we're trying to convert is -1
|
||||
if (!strlen($bytes)) { // eg. if the number we're trying to convert is -1
|
||||
$bytes = chr(0);
|
||||
}
|
||||
|
||||
|
@ -375,6 +375,7 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
||||
$n = $this->getInstance(2);
|
||||
$x->powMod($e, $n);
|
||||
}
|
||||
|
||||
public function testRoot()
|
||||
{
|
||||
$bigInteger = $this->getInstance('64000000'); // (20^2)^3
|
||||
@ -429,4 +430,13 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
||||
$b = $this->getInstance('00', 16);
|
||||
$this->assertTrue($a->equals($b));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group github1264
|
||||
*/
|
||||
public function test48ToHex()
|
||||
{
|
||||
$temp = $this->getInstance(48);
|
||||
$this->assertSame($temp->toHex(true), '30');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user