1
0
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:
terrafrost 2018-04-10 00:19:49 -05:00
commit ab270d1602
2 changed files with 11 additions and 1 deletions

View File

@ -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);
}

View File

@ -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');
}
}