Download the PHP package mougrim/fast-uuid without Composer

On this page you can find all versions of the php package mougrim/fast-uuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fast-uuid

mougrim/fast-uuid

A PHP library for generating and working with UUIDs faster than ramsey/uuid in many cases.

Source Code Download Package PHP Programming Language Read License

mougrim/fast-uuid is a PHP library for generating and working with universally unique identifiers (UUIDs).

mougrim/fast-uuid is based on the source code of ramsey/uuid and used it as a dependency, but it is faster in many cases.

Installation

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

Documentation

Creating the factory:

If you want to use lazy initialization, create the factory in the following way:

After creating the factory, you can use it as ramsey/uuid, for example, to generate a UUID v7:

For more information, see the ramsey/uuid documentation.

Problem

ramsey/uuid is slow (sometimes very slow) when not using lazy initialization.

To use lazy initialization, you have to use static methods like Uuid::fromString(), Uuid::uuid7(), etc., with the default factory. If you use Uuid::getFactory() or change the default factory, you can't use lazy initialization.

So, if you want to use dependency injection (DI) or a non-default factory, you can't use the lazy initialization of ramsey/uuid.

mougrim/fast-uuid has a much faster non-lazy initialization than ramsey/uuid.

mougrim/fast-uuid has the same speed for lazy initialization as ramsey/uuid, but in cases where you need to unwrap a UUID (for example, to get the timestamp from it), mougrim/fast-uuid is much faster.

Benchmark

To run the benchmark, use the following command:

The result:

Transcript:

As you see, generation isn't optimized, but if needed you can make a MR 🙂

If you use only fromString and toString conversions, and you don't need DI and custom UUID factory, ramsey/uuid will be optimal for you.

In any other cases, it is better to use mougrim/fast-uuid with or without lazy initialization.

Restrictions

Copyright and License

The mougrim/fast-uuid library is copyright © Mougrim and licensed for use under the MIT License (MIT). Please see license.md for more information.


All versions of fast-uuid with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ramsey/uuid Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mougrim/fast-uuid contains the following files

Loading the files please wait ....