PHPackages                             sschiau/particle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sschiau/particle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sschiau/particle
================

3.0.0(7mo ago)1313.9k281MITPHPPHP ^8.4.14CI passing

Since Aug 16Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/sschiau/Particle)[ Packagist](https://packagist.org/packages/sschiau/particle)[ RSS](/packages/sschiau-particle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (1)Versions (10)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/6a27aee38e1abbb5556cbc68a792fa898a17258ead3bfc7f4c78ab35f9544810/68747470733a2f2f706f7365722e707567782e6f72672f737363686961752f7061727469636c652f762f737461626c65)](https://packagist.org/packages/sschiau/particle)[![License](https://camo.githubusercontent.com/2e6a9905599a43f98a537eeffca6007771160284e2abdd1633543c72dc82b8f1/68747470733a2f2f706f7365722e707567782e6f72672f737363686961752f7061727469636c652f6c6963656e7365)](https://packagist.org/packages/sschiau/particle)

Particle
========

[](#particle)

#### Language: PHP

[](#language-php)

#### 64bits int Time Based ID Generator

[](#64bits-int-time-based-id-generator)

### Uncoordinated

[](#uncoordinated)

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

### Solution

[](#solution)

- PHP (tested on v8.4.14)
- 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

[](#system-clock-dependency)

You should use NTP to keep your system clock accurate.

How to use it
-------------

[](#how-to-use-it)

#### Generate Particle ID

[](#generate-particle-id)

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

```
	$machineID = 0; // Machine ID (aka Server ID no.)
	Particle::generateParticle($machineID);
```

#### Time from Particle ID (w/ millisecond precision)

[](#time-from-particle-id-w-millisecond-precision)

```
	$particleID = '4611691166465789880';
	Particle::timeFromParticle($particleID);
```

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity36

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~483 days

Recently: every ~817 days

Total

8

Last Release

222d ago

Major Versions

1.1.2 → 2.0.02016-11-19

2.2.2 → 3.0.02025-11-20

PHP version history (3 changes)1.1.2PHP ^5.5.3 || ^7.0

2.2.1PHP ^7.1.7

3.0.0PHP ^8.4.14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3709649?v=4)[Silviu](/maintainers/sschiau)[@sschiau](https://github.com/sschiau)

---

Top Contributors

[![sschiau](https://avatars.githubusercontent.com/u/3709649?v=4)](https://github.com/sschiau "sschiau (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![tradzero](https://avatars.githubusercontent.com/u/13845447?v=4)](https://github.com/tradzero "tradzero (1 commits)")

---

Tags

idsmilisecondsphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sschiau-particle/health.svg)

```
[![Health](https://phpackages.com/badges/sschiau-particle/health.svg)](https://phpackages.com/packages/sschiau-particle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
