Download the PHP package krmgns/uuid without Composer

On this page you can find all versions of the php package krmgns/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 uuid

While preserving version & variant fields of generated values, Uuid library provides three types of UUIDs with a simple and fast approach, and can be used where sortable UUIDs are needed.

The generate() method of;

Besides these UUIDs are sortable, they can be used for some sort of jobs like folder exploration (say, where we are working with an image cropping service).

So, as a quick example, let's see it in action;

Installing

Notes / Reminding

· Besides all classes can take $value argument (#1) as type of string, Uuid\Uuid class can also take type of Uuid\Uuid, Uuid\DateUuid class can also take type of Uuid\DateUuid, Uuid\DateTimeUuid class can also take type of Uuid\DateTimeUuid, but it also can be skipped for auto-generation at the same time.

· Besides Uuid\Uuid is implementing Stringable interface, Uuid\DateUuid and Uuid\DateTimeUuid are subclasses of Uuid\Uuid class. So, while inheriting some useful methods (toString(), toHashString(), etc.), they also overrides some methods (isValid(), generate(), validate() etc.) alongside __constructor() methods.

· Since Uuid\DateTimeUuid uses an instant date/time stamp up to seconds (format: YmdHis), the best sortable UUIDs can only be generated with this class.

The Uuid\Uuid Class

Like the inheriting classes, when no $value (UUID value) given, Uuid\Uuid class will generate and assign its value by itself. Otherwise, given value will be assigned after it's checked in strict mode (modifier argument is $strict as true) whether it's a valid UUID value or not.

Statics

See test/unit/UuidTest.php for more examples.

The Uuid\DateUuid Class

This class uses 12-length random bytes and 4-length bytes of UTC date as prefix. So, its date can be re-taken (eg: 20231212 or 2023-12-12 with $separator option) to use for any use case and it's usable for where sortable UUIDs are needed.

Statics

See test/unit/DateUuidTest.php for more examples.

The Uuid\DateTimeUuid Class

This class uses 10-length random bytes and 6-length bytes of UTC date/time as prefix. So, its date can be re-taken (eg: 20231212, 101122 or 2023-12-12, 10-11-22 with $separator option) to use for any use case and it's usable for where sortable UUIDs are needed.

Statics

See test/unit/DateTimeUuidTest.php for more examples.


All versions of uuid with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-ctype Version *
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 krmgns/uuid contains the following files

Loading the files please wait ...