Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Latest commit

 

History

History
29 lines (17 loc) · 890 Bytes

README.md

File metadata and controls

29 lines (17 loc) · 890 Bytes

simpleflake-PHP

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