function BrickMathCalculator::toBase
Overrides CalculatorInterface::toBase
1 call to BrickMathCalculator::toBase()
- BrickMathCalculator::toHexadecimal in vendor/
ramsey/ uuid/ src/ Math/ BrickMathCalculator.php - Converts an Integer instance to a Hexadecimal instance
File
-
vendor/
ramsey/ uuid/ src/ Math/ BrickMathCalculator.php, line 114
Class
- BrickMathCalculator
- A calculator using the brick/math library for arbitrary-precision arithmetic
Namespace
Ramsey\Uuid\MathCode
public function toBase(IntegerObject $value, int $base) : string {
try {
return BigInteger::of($value->toString())
->toBase($base);
} catch (MathException|\InvalidArgumentException $exception) {
throw new InvalidArgumentException($exception->getMessage(), (int) $exception->getCode(), $exception);
}
}