SkillAgentSearch skills...

Atom

PHP unique ID generator

Install / Use

/learn @liexusong/Atom
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Atom

PHP unique ID generator, based on the Twitter snowflake algorithm

APIs:

/*
 * Get the next unique ID
 */
string atom_next_id()

/*
 * Change unique ID to array includes: timestamp, datacenter id and worker id
 */
array atom_explain(string $id)

example:

<?php
$id = atom_next_id();
echo $id;

$info = atom_explain($id);
echo date('Y-m-d H:i:s', $info['timestamp']);
?>

install:

$  cd ./atom
$  phpize
$  ./configure
$  make
$  sudo make install

php.ini configure entries:

[atom]
atom.datacenter = integer
atom.worker = integer
atom.twepoch = uint64

Related Skills

View on GitHub
GitHub Stars187
CategoryDevelopment
Updated1mo ago
Forks46

Languages

C

Security Score

80/100

Audited on Feb 13, 2026

No findings