Skip to content

yiranzai/php-snowflake

Repository files navigation

snowflake

ENGLISH | 中文

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This package to generate 64 bit identifier, use snowflakes from Twitter.

Structure

src/
tests/

Install

Via Composer

$ composer require yiranzai/snowflake

Usage

$id = \Yiranzai\SnowFlake\SnowFlake::next($dataCenterId = 1, $workerId = 2);
$node = \Yiranzai\SnowFlake\SnowFlake::analysis($id);

echo $node->dataCenterID; // 1
echo $node->workerID; // 2

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

This package to generate 64 bit identifier, use snowflakes from Twitter.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages