Remove dependency to moontoast/math (#426)

This commit is contained in:
Alexander Schranz
2022-08-05 18:50:28 +02:00
committed by GitHub
parent bd2df8d29d
commit a800c468aa
3 changed files with 6 additions and 302 deletions
+4 -4
View File
@@ -2,7 +2,7 @@
namespace Ramsey\Uuid\Test;
use Moontoast\Math\BigNumber;
use Brick\Math\BigInteger;
use Ramsey\Uuid\Builder\DegradedUuidBuilder;
use Ramsey\Uuid\Codec\CodecInterface;
use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
@@ -246,12 +246,12 @@ class ExpectedBehaviorTest extends TestCase
{
$leastSignificantBitsHex = substr(str_replace('-', '', $string), 16);
$mostSignificantBitsHex = substr(str_replace('-', '', $string), 0, 16);
$leastSignificantBits = BigNumber::convertToBase10($leastSignificantBitsHex, 16);
$mostSignificantBits = BigNumber::convertToBase10($mostSignificantBitsHex, 16);
$leastSignificantBits = BigInteger::fromBase($leastSignificantBitsHex, 16)->__toString();
$mostSignificantBits = BigInteger::fromBase($mostSignificantBitsHex, 16)->__toString();
$components = explode('-', $string);
array_walk($components, function (&$value) {
$value = BigNumber::convertToBase10($value, 16);
$value = BigInteger::fromBase($value, 16)->__toString();
});
$clockSeq = (int) $components[3] & 0x3fff;