{"id":13792335,"url":"https://github.com/sschiau/Particle","last_synced_at":"2025-05-12T14:31:49.538Z","repository":{"id":7695618,"uuid":"9059753","full_name":"sschiau/Particle","owner":"sschiau","description":"64 bit ID Generator","archived":false,"fork":false,"pushed_at":"2022-02-16T18:33:36.000Z","size":86,"stargazers_count":133,"open_issues_count":0,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-22T04:49:05.385Z","etag":null,"topics":["ids","miliseconds","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sschiau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-27T17:34:40.000Z","updated_at":"2024-12-25T09:16:45.000Z","dependencies_parsed_at":"2022-07-09T20:31:18.433Z","dependency_job_id":null,"html_url":"https://github.com/sschiau/Particle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschiau%2FParticle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschiau%2FParticle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschiau%2FParticle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschiau%2FParticle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sschiau","download_url":"https://codeload.github.com/sschiau/Particle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253754967,"owners_count":21958934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ids","miliseconds","php"],"created_at":"2024-08-03T22:01:11.118Z","updated_at":"2025-05-12T14:31:49.210Z","avatar_url":"https://github.com/sschiau.png","language":"PHP","readme":"[![Build Status](https://travis-ci.org/sschiau/Particle.svg?branch=master)](https://travis-ci.org/sschiau/Particle)\n[![Latest Stable Version](https://poser.pugx.org/sschiau/particle/v/stable)](https://packagist.org/packages/sschiau/particle)\n[![License](https://poser.pugx.org/sschiau/particle/license)](https://packagist.org/packages/sschiau/particle)\n\n# Particle\n#### Language: PHP\n#### 64bits int Time Based ID Generator\n\n### Uncoordinated\nFor high availability within and across data centers, machines generating ids should not have to coordinate with each other.\n\n### Solution\n* PHP (tested on v7.1.8)\n* Particle Id (64 bits) is composed of:\n  * time - 42 bits (millisecond precision w/ a custom epoch)\n  * configured machine id - 10 bits - up to 1024 machines\n  * sequence number - 12 bits - up to 4096 random numbers\n\n### System Clock Dependency\nYou should use NTP to keep your system clock accurate.\n\n## How to use it\n#### Generate Particle ID\nChange const EPOCH in particle class to today epoch time w/ millisecond (13 digits)\n\n```PHP\n\t$machineID = 0; // Machine ID (aka Server ID no.)\n\tParticle::generateParticle($machineID);\n```\n\n#### Time from Particle ID (w/ millisecond precision)\n```PHP\n\t$particleID = '4611692470816737853';\n\tParticle::timeFromParticle($particleID);\n```\n","funding_links":[],"categories":["数字( Numbers )","类库"],"sub_categories":["未归类"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschiau%2FParticle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsschiau%2FParticle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschiau%2FParticle/lists"}