GenericNumberConverter
in package
implements
NumberConverterInterface
GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values
Tags
Interfaces, Classes, Traits and Enums
- NumberConverterInterface
- A number converter converts UUIDs from hexadecimal characters into representations of integers and vice versa
Table of Contents
- $calculator : CalculatorInterface
- __construct() : mixed
- fromHex() : string
- Converts a hexadecimal number into an string integer representation of the number
- toHex() : string
- Converts a string integer representation into a hexadecimal string representation of the number
Properties
$calculator
private
CalculatorInterface
$calculator
Methods
__construct()
public
__construct(CalculatorInterface $calculator) : mixed
Parameters
- $calculator : CalculatorInterface
Return values
mixed —fromHex()
Converts a hexadecimal number into an string integer representation of the number
public
fromHex(string $hex) : string
Parameters
- $hex : string
-
The hexadecimal string representation to convert
Tags
Return values
string —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
- $number : string
-
A string integer representation to convert; this must be a numeric string to accommodate unsigned integers greater than PHP_INT_MAX.
Tags
Return values
string —Hexadecimal string