appkweb/uuid

Light lib to generate an universally unique identifier V4

Maintainers

Details

github.com/appkweb/uuid

Source

Issues

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/appkweb/uuid

1.0.0 2024-09-10 23:22 UTC

This package is auto-updated.

Last update: 2026-01-11 02:09:28 UTC


README

Light lib to generate an universally unique identifier V4

Get started

  • composer install appkweb/uuid
  • public function __construct(
          private readonly UuidService $uuidService,
      )
      {
      }
    
      /**
       * @return void
       * @throws Exception
       */
      public function __invoke():void
      {
          echo "{$this->uuidService->generate()}\n";
      }
    

Sources of Entropy

  • Generates 16 random bytes with high entropy, which is excellent for value diversity.
  • Provides a timestamp in milliseconds, adding a time dimension.
  • Includes the process ID, which varies between processes but is stable during the execution of a specific process.
  • Generates an additional random number, adding even more diversity.
  • Generates a unique identifier based on the current time and a random number, used in the hash to add additional entropy.