Skip to content
64 bit ID Generator
Branch: master
Clone or download
Latest commit 2a0b209 Sep 27, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Sep 27, 2018
Demo Bump version to 2.2.2 Oct 20, 2017
Sources Bump version to 2.2.2 Oct 20, 2017
Tests Bump version to 2.2.2 Oct 20, 2017
.travis.yml Update Travis PHP version for testing to 7.1.7 Aug 27, 2017 Bump version to 2.2.2 Oct 20, 2017 Create Aug 26, 2017 Create Aug 26, 2017 Changed license from Apache 2.0 to MIT License Oct 20, 2017
composer.json Change to valid SPDX license identifier Feb 24, 2018
composer.lock Auto bump versions Aug 27, 2017

Build Status Latest Stable Version License


Language: PHP

64bits int Time Based ID Generator


For high availability within and across data centers, machines generating ids should not have to coordinate with each other.


  • PHP (tested on v7.1.8)
  • Particle Id (64 bits) is composed of:
    • time - 42 bits (millisecond precision w/ a custom epoch)
    • configured machine id - 10 bits - up to 1024 machines
    • sequence number - 12 bits - up to 4096 random numbers

System Clock Dependency

You should use NTP to keep your system clock accurate.

How to use it

Generate Particle ID

Change const EPOCH in particle class to today epoch time w/ miliseconds (13 digits)

	$machineID = 0; // Machine ID (aka Server ID no.)

Time from Particle ID (w/ milisecond precision)

	$particleID = '4611692470816737853';
You can’t perform that action at this time.