Skip to content

foooy/atom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atom

Based on the Twitter Snowflake algorithm

PHP unique ID generator

functions list:

    1. string atom_next_id(void);
         Get the next unique ID.
    1. array atom_explain(string ID);
         Change unique ID to array includes: timestamp, datacenter id and worker id.

example:

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


<h3>install:</h3>
<pre><code>
$  cd ./atom
$  phpize
$  ./configure
$  make
$  sudo make install
</code></pre>

<h3>php.ini configure entries:</h3>
<pre><code>
[atom]
atom.datacenter = integer
atom.worker = integer
atom.twepoch = uint64
</code></pre>

About

PHP unique ID generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 82.1%
  • M4 10.8%
  • PHP 5.6%
  • JavaScript 1.5%