Debian Codegraph @

vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.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\Generator;
16
17 use Exception;
18 use InvalidArgumentException;
19 use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
20
21 /**
22 * TimeGeneratorInterface provides functionality to generate strings of binary
23 * data for version 1 UUIDs based on a host ID, sequence number, and the current
24 * time
25 */
26 interface TimeGeneratorInterface
27 {
28 /**
29 * Generate a version 1 UUID from a host ID, sequence number, and the current time
30 *
31 * @param int|string $node A 48-bit number representing the hardware address
32 * This number may be represented as an integer or a hexadecimal string.
33 * @param int $clockSeq A 14-bit number used to help avoid duplicates that
34 * could arise when the clock is set backwards in time or if the node ID
35 * changes.
36 * @return string A binary string
37 * @throws UnsatisfiedDependencyException if called on a 32-bit system and
38 * `Moontoast\Math\BigNumber` is not present
39 * @throws InvalidArgumentException
40 * @throws Exception if it was not possible to gather sufficient entropy
41 */
42 public function generate($node = null, $clockSeq = null);
43 }