1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-27 04:34:45 +01:00

Merge branch '1.0' into 2.0

This commit is contained in:
terrafrost 2018-04-09 23:57:25 -05:00
commit 4548b45b9e
2 changed files with 10 additions and 1 deletions

View File

@ -539,7 +539,7 @@ class BigInteger
$temp = $comparison < 0 ? $this->add(new static(1)) : $this->copy(); $temp = $comparison < 0 ? $this->add(new static(1)) : $this->copy();
$bytes = $temp->toBytes(); $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); $bytes = chr(0);
} }

View File

@ -394,4 +394,13 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
$n = $this->getInstance(2); $n = $this->getInstance(2);
$x->powMod($e, $n); $x->powMod($e, $n);
} }
/**
* @group github1264
*/
public function test48ToHex()
{
$temp = $this->getInstance(48);
$this->assertSame($temp->toHex(true), '30');
}
} }