Download the PHP package ennexa/snowflake without Composer
On this page you can find all versions of the php package ennexa/snowflake. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ennexa/snowflake
More information about ennexa/snowflake
Files in ennexa/snowflake
Download ennexa/snowflake
More information about ennexa/snowflake
Files in ennexa/snowflake
Vendor ennexa
Package snowflake
Short Description Snowflake ID Generator that does not require a daemon
License MIT
Package snowflake
Short Description Snowflake ID Generator that does not require a daemon
License MIT
Please rate this library. Is it a good library?
Informations about the package snowflake
Snowflake ID Generator
An implementation of Snowflake ID generator that works without a dedicated daemon.
The generator can be used with PHP-FPM
or mod_php
.
Installation
composer require ennexa/snowflake
Usage
// First we need to create a store for saving the state
$store = new \Ennexa\Snowflake\Store\RedisStore(new \Redis);
// $store = new \EnnexaSnowflake\Store\FileStore('/path/to/store/state');
// Create a generator with the created store
$generator = new \EnnexaSnowflake\Generator($store, $instanceId = 0);
// Use Generator::nextId to generate the next unique id
echo $generator->nextId();
Credits
This generator was originally created for use on Prokerala.com.
All versions of snowflake with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
The package ennexa/snowflake contains the following files
Loading the files please wait ....