[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/ramsey/uuid/src/Generator/ -> PeclUuidTimeGenerator.php (source)

   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  /**
  18   * PeclUuidTimeGenerator provides functionality to generate strings of binary
  19   * data for version 1 UUIDs using the PECL UUID PHP extension
  20   *
  21   * @link https://pecl.php.net/package/uuid
  22   */
  23  class PeclUuidTimeGenerator implements TimeGeneratorInterface
  24  {
  25      /**
  26       * Generate a version 1 UUID using the PECL UUID extension
  27       *
  28       * @param int|string $node Not used in this context
  29       * @param int $clockSeq Not used in this context
  30       * @return string A binary string
  31       */
  32      public function generate($node = null, $clockSeq = null)
  33      {
  34          $uuid = uuid_create(UUID_TYPE_TIME);
  35  
  36          return uuid_parse($uuid);
  37      }
  38  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer