michaelcontento / simpleflake-php
Installs: 215
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 0
Forks: 4
pkg:composer/michaelcontento/simpleflake-php
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2020-01-20 03:39:08 UTC
README
Distributed ID generation in PHP for the lazy. Based on the awesome python implementation from SawdustSoftware.
You can read an overview of what this does and why it came into being at the Sawdust Software Blog.
Usage
<?php require "simpleflake.php"; $newId = \simpleflake\generate(); echo "ID: $newId\n"; $parts = \simpleflake\parse($newId); echo "Timestamp: " . $parts["timestamp"] . "\n"; echo "RandomBits: " . $parts["randomBits"] . "\n";