PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
media-cloud-sync / includes / sdk / google / ramsey / uuid / src / Codec / TimestampLastCombCodec.php

TimestampLastCombCodec.php in Media Cloud Sync 1.4.1, at includes/sdk/google/ramsey/uuid/src/Codec/TimestampLastCombCodec.php

47 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 <ben@benramsey.com>
10 * @license http://opensource.org/licenses/MIT MIT
11 */
12 declare (strict_types=1);
13 namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Codec;
14
15 /**
16 * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the last 48 bits
17 *
18 * The CombGenerator when used with the StringCodec (and, by proxy, the TimestampLastCombCodec) adds the timestamp to
19 * the last 48 bits of the COMB. The TimestampLastCombCodec is provided for the sake of consistency. In practice, it is
20 * identical to the standard StringCodec, but it may be used with the CombGenerator for additional context when reading
21 * code.
22 *
23 * Consider the following code. By default, the codec used by UuidFactory is the StringCodec, but here, we explicitly
24 * set the TimestampLastCombCodec. It is redundant, but it is clear that we intend this COMB to be generated with the
25 * timestamp appearing at the end.
26 *
27 * ```
28 * $factory = new UuidFactory();
29 *
30 * $factory->setCodec(new TimestampLastCombCodec($factory->getUuidBuilder()));
31 *
32 * $factory->setRandomGenerator(new CombGenerator(
33 * $factory->getRandomGenerator(),
34 * $factory->getNumberConverter(),
35 * ));
36 *
37 * $timestampLastComb = $factory->uuid4();
38 * ```
39 *
40 * @deprecated Please use {@see StringCodec} instead.
41 *
42 * @immutable
43 */
44 class TimestampLastCombCodec extends StringCodec
45 {
46 }
47