michaelcontento/simpleflake-php

This package is abandoned and no longer maintained. No replacement package was suggested.

Maintainers

Package info

github.com/michaelcontento/simpleflake-php

pkg:composer/michaelcontento/simpleflake-php

Statistics

Installs: 215

Dependents: 0

Suggesters: 0

Stars: 5

dev-master 2015-12-07 09:15 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:39:08 UTC


README

Travis Status: Build Status

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";