{"id":35873345,"url":"https://github.com/antikirra/tsid","last_synced_at":"2026-01-08T16:04:53.552Z","repository":{"id":65814466,"uuid":"600507996","full_name":"antikirra/tsid","owner":"antikirra","description":"Ultra-fast PHP library for generating unique timestamp-based IDs with nanosecond precision. Zero dependencies, 39M+ IDs/sec, PHP 5.6-8.4+ compatible. Perfect Snowflake ID alternative for distributed systems, microservices, and high-load applications.","archived":false,"fork":false,"pushed_at":"2025-10-19T08:12:25.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T10:44:31.232Z","etag":null,"topics":["high-performance","microtime-based-id","php-id-generator","snowflake-alternative","timestamp-id","unique-identifier","zero-dependencies"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antikirra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-11T17:55:44.000Z","updated_at":"2025-10-19T08:12:29.000Z","dependencies_parsed_at":"2024-02-12T15:11:57.403Z","dependency_job_id":"f8d4bde3-0f07-4490-ad97-e84969e2846d","html_url":"https://github.com/antikirra/tsid","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"46d301c02141a6ffa8b0fb291eaf79f5e595c9d5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/antikirra/tsid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antikirra%2Ftsid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antikirra%2Ftsid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antikirra%2Ftsid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antikirra%2Ftsid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antikirra","download_url":"https://codeload.github.com/antikirra/tsid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antikirra%2Ftsid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28246677,"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","status":"online","status_checked_at":"2026-01-08T02:00:06.591Z","response_time":241,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["high-performance","microtime-based-id","php-id-generator","snowflake-alternative","timestamp-id","unique-identifier","zero-dependencies"],"created_at":"2026-01-08T16:01:27.206Z","updated_at":"2026-01-08T16:04:53.546Z","avatar_url":"https://github.com/antikirra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TSID | TimeStampable IDentifier\n\n![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/antikirra/tsid/php)\n![Packagist Version](https://img.shields.io/packagist/v/antikirra/tsid)\n![Code Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)\n\n**Ultra-fast, lightweight PHP library for generating unique timestamp-based identifiers with nanosecond precision.** Perfect for distributed systems, high-throughput applications, and scenarios requiring guaranteed unique ID generation without external dependencies.\n\n## Install\n\n```console\ncomposer require antikirra/tsid:^3.0\n```\n\n## Why TSID?\n\n- ✨ **Blazing Fast Performance** - Zero dependencies, minimal overhead, optimized for speed\n- 🔧 **Universal Compatibility** - Works seamlessly from PHP 5.6 to PHP 8.4+\n- ⚡ **Nanosecond Precision** - Guaranteed uniqueness even in high-frequency generation\n- 🎯 **Snowflake Alternative** - Simple, efficient replacement for complex ID generators\n- 📦 **Lightweight** - Compact, pure PHP implementation with no bloat\n- 🚀 **Production Ready** - Battle-tested in high-load distributed environments\n\n## Features\n\n- **High-Performance ID Generation**: Up to 39M+ unique IDs per second (Apple M4, PHP 8.4)\n- **Timestamp-Based**: IDs contain creation time information for easy sorting and analysis\n- **Strictly Monotonic**: Guarantees each ID is always greater than the previous, even during clock adjustments\n- **Collision-Free**: Mathematical guarantee of uniqueness within single process\n- **Memory Efficient**: Minimal memory footprint, perfect for microservices\n- **Legacy Support**: Compatible with ancient PHP versions (5.6+) and modern PHP 8.4\n- **Zero Dependencies**: No external libraries, frameworks, or extensions required\n- **Process-Safe**: Safe for use in single-threaded PHP processes with static state management\n- **100% Test Coverage**: Fully tested with 42 test cases and 5,781 assertions\n\n## Perfect for\n\n- **Distributed Systems**: Unique ID generation across multiple servers\n- **High-Frequency APIs**: REST APIs, microservices, real-time applications\n- **Database Primary Keys**: Alternative to auto-increment IDs in sharded databases\n- **Logging \u0026 Tracing**: Unique request IDs, transaction tracking\n- **Message Queues**: Job IDs, task identifiers in queue systems\n- **Legacy Systems**: Drop-in solution for old PHP applications requiring unique IDs\n\n## Requirements\n\n- **PHP**: 5.6 or higher\n- **Extensions**: None (uses only core PHP functions)\n- **Memory**: Minimal (\u003c 1MB)\n- **Dependencies**: Zero\n\n## Basic usage\n\n```php\n\u003c?php\n\nuse function Antikirra\\tsid;\nuse function Antikirra\\tsids;\n\nrequire __DIR__ . '/vendor/autoload.php';\n\necho tsid(); // (int) 1752909802717089759\n\nvar_dump(tsids(2)); // array(2) { [0] =\u003e int(1752909802717089762) [1] =\u003e int(1752909802717090791) }\n```\n\n## Testing\n\nThe library is thoroughly tested with comprehensive test coverage:\n\n- **Test Framework**: Pest\n- **Total Tests**: 42 passing\n- **Total Assertions**: 5,781\n- **Code Coverage**: 100% (lines and functions)\n\n### Test Categories\n\n- **Basic Functionality**: ID generation, type validation, uniqueness\n- **Monotonicity**: Strictly ascending order verification\n- **Batch Generation**: Mass ID generation (up to 10,000 IDs)\n- **Precision**: Nanosecond-level timestamp accuracy\n- **Edge Cases**: Input validation, boundary conditions\n- **Performance**: High-frequency generation tests\n\n## Keywords\n\ntimestamp-id, unique-identifier, php-id-generator, high-performance, snowflake-alternative, distributed-systems, nanosecond-precision, php-5.6-compatible, zero-dependencies, microtime-based-id\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantikirra%2Ftsid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantikirra%2Ftsid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantikirra%2Ftsid/lists"}