Debian Codegraph @

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

raw
1 <?php
2 /**
3 * This file is part of the ramsey/uuid library
4 *
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
7 *
8 * @copyright Copyright (c) Ben Ramsey <[email protected]>
9 * @license http://opensource.org/licenses/MIT MIT
10 * @link https://benramsey.com/projects/ramsey-uuid/ Documentation
11 * @link https://packagist.org/packages/ramsey/uuid Packagist
12 * @link https://github.com/ramsey/uuid GitHub
13 */
14
15 namespace Ramsey\Uuid\Converter;
16
17 use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
18
19 /**
20 * NumberConverterInterface converts UUIDs from hexadecimal characters into
21 * representations of integers and vice versa
22 */
23 interface NumberConverterInterface
24 {
25 /**
26 * Converts a hexadecimal number into an integer representation of the number
27 *
28 * The integer representation returned may be an object or a string
29 * representation of the integer, depending on the implementation.
30 *
31 * @param string $hex The hexadecimal string representation to convert
32 * @return mixed
33 * @throws UnsatisfiedDependencyException if `Moontoast\Math\BigNumber` is not present
34 */
35 public function fromHex($hex);
36
37 /**
38 * Converts an integer representation into a hexadecimal string representation
39 * of the number
40 *
41 * @param mixed $integer An integer representation to convert; this may be
42 * a true integer, a string integer, or a object representation that
43 * this converter can understand
44 * @return string Hexadecimal string
45 * @throws UnsatisfiedDependencyException if `Moontoast\Math\BigNumber` is not present
46 */
47 public function toHex($integer);
48 }