# media-cloud-sync/1.2.13/includes/sdk/google/ramsey/uuid/src/Rfc4122/UuidV4.php

Media Cloud Sync, version 1.2.13. 48 lines.

- Page: https://pluginprobe.com/plugins/media-cloud-sync/1.2.13/code/includes/sdk/google/ramsey/uuid/src/Rfc4122/UuidV4.php
- Raw: https://pluginprobe.com/plugins/media-cloud-sync/1.2.13/raw/includes/sdk/google/ramsey/uuid/src/Rfc4122/UuidV4.php
- Modified: 2024-10-27T10:40:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/media-cloud-sync/1.2.13/code/includes/sdk/google/ramsey/uuid/src/Rfc4122/UuidV4.php#L10-L20`.

```php
<?php

/**
 * This file is part of the ramsey/uuid library
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
 * @license http://opensource.org/licenses/MIT MIT
 */
declare (strict_types=1);
namespace Dudlewebs\WPMCS\Ramsey\Uuid\Rfc4122;

use Dudlewebs\WPMCS\Ramsey\Uuid\Codec\CodecInterface;
use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\NumberConverterInterface;
use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\TimeConverterInterface;
use Dudlewebs\WPMCS\Ramsey\Uuid\Exception\InvalidArgumentException;
use Dudlewebs\WPMCS\Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface;
use Dudlewebs\WPMCS\Ramsey\Uuid\Uuid;
/**
 * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit
 * integers
 *
 * @psalm-immutable
 */
final class UuidV4 extends Uuid implements UuidInterface
{
    /**
     * Creates a version 4 (random) UUID
     *
     * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID
     * @param NumberConverterInterface $numberConverter The number converter to use
     *     for converting hex values to/from integers
     * @param CodecInterface $codec The codec to use when encoding or decoding
     *     UUID strings
     * @param TimeConverterInterface $timeConverter The time converter to use
     *     for converting timestamps extracted from a UUID to unix timestamps
     */
    public function __construct(Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, TimeConverterInterface $timeConverter)
    {
        if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) {
            throw new InvalidArgumentException('Fields used to create a UuidV4 must represent a ' . 'version 4 (random) UUID');
        }
        parent::__construct($fields, $numberConverter, $codec, $timeConverter);
    }
}

```
