Download the PHP package tuupola/ksuid without Composer
On this page you can find all versions of the php package tuupola/ksuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tuupola/ksuid
More information about tuupola/ksuid
Files in tuupola/ksuid
Package ksuid
Short Description K-Sortable Globally Unique IDs
License MIT
Homepage https://github.com/tuupola/ksuid
Informations about the package ksuid
KSUID
This library implements the K-Sortable Globally Unique IDs from Segment. See also the article called A Brief History of the UUID.
KSUID is for K-Sortable Unique IDentifier. It's a way to generate globally unique IDs similar to RFC 4122 UUIDs, but contain a time component so they can be "roughly" sorted by time of creation. The remainder of the KSUID is randomly generated bytes.
Install
Install with composer.
This branch requires PHP 7.1 or up. The older 1.x branch supports also PHP 5.6 and 7.0.
Usage
Included Base62 implementation has both PHP and GMP based encoders. By default encoder and decoder will use GMP functions if the extension is installed. If GMP is not available pure PHP encoder will be used instead.
Note! Throughout the code the term timestamp refers to KSUID timestamp. The term unixtime refers to the traditional Unix time. KSUID timestamp and Unix time have different Epoch.
If you prefer static syntax you can use one of the provided factories.
Testing
You can run tests either manually or automatically on every code change. Automatic tests require entr to work.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.