Debian Codegraph @

vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php

raw
1 <?php
2
3 /**
4 * This file is part of the ramsey/uuid library
5 *
6 * For the full copyright and license information, please view the LICENSE
7 * file that was distributed with this source code.
8 *
9 * @copyright Copyright (c) Ben Ramsey <[email protected]>
10 * @license http://opensource.org/licenses/MIT MIT
11 */
12
13 declare(strict_types=1);
14
15 namespace Ramsey\Uuid\Converter;
16
17 /**
18 * A number converter converts UUIDs from hexadecimal characters into representations of integers and vice versa
19 *
20 * @immutable
21 */
22 interface NumberConverterInterface
23 {
24 /**
25 * Converts a hexadecimal number into a string integer representation of the number
26 *
27 * The integer representation returned is a string representation of the integer to accommodate unsigned integers
28 * that are greater than `PHP_INT_MAX`.
29 *
30 * @param string $hex The hexadecimal string representation to convert
31 *
32 * @return numeric-string String representation of an integer
33 *
34 * @pure
35 */
36 public function fromHex(string $hex): string;
37
38 /**
39 * Converts a string integer representation into a hexadecimal string representation of the number
40 *
41 * @param string $number A string integer representation to convert; this must be a numeric string to accommodate
42 * unsigned integers that are greater than `PHP_INT_MAX`.
43 *
44 * @return non-empty-string Hexadecimal string
45 *
46 * @pure
47 */
48 public function toHex(string $number): string;
49 }