Skip to content

GenericNumberConverter

GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values

Properties

calculator

private \Ramsey\Uuid\Math\CalculatorInterface $calculator

Methods

__construct

public __construct(\Ramsey\Uuid\Math\CalculatorInterface $calculator): mixed

Parameters:

Parameter Type Description
$calculator \Ramsey\Uuid\Math\CalculatorInterface

fromHex

Converts a hexadecimal number into an string integer representation of the number

public fromHex(string $hex): string

Parameters:

Parameter Type Description
$hex string The hexadecimal string representation to convert

Return Value:

String representation of an integer


toHex

Converts a string integer representation into a hexadecimal string representation of the number

public toHex(string $number): string

Parameters:

Parameter Type Description
$number string A string integer representation to convert; this
must be a numeric string to accommodate unsigned integers greater
than PHP_INT_MAX.

Return Value:

Hexadecimal string



Automatically generated on 2025-03-18