Skip to content
This package to generate 64 bit identifier, use snowflakes from Twitter.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
tests
.editorconfig
.gitattributes
.gitignore
.scrutinizer.yml
.styleci.yml
.travis.yml
README.md
composer.json
phpcs.xml.dist
phpunit.xml.dist

README.md

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 wuqingdzx@gmail.com instead of using the issue tracker.

Credits

License

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

You can’t perform that action at this time.