Download the PHP package hejunjie/id-generator without Composer
On this page you can find all versions of the php package hejunjie/id-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hejunjie/id-generator
More information about hejunjie/id-generator
Files in hejunjie/id-generator
Package id-generator
Short Description 轻量级 PHP ID 生成器,提供雪花算法、UUID、时间戳和自定义可读 ID 等多种策略,确保全局唯一性与高并发性能,可轻松集成到任何 PHP 项目,适用于订单号、资源标识、日志追踪等多种业务场景 | A lightweight PHP ID generator supporting Snowflake, UUID, timestamp, and custom readable ID strategies. Ensures global uniqueness and high-performance, easily integrable into any PHP project, suitable for order numbers, resource identifiers, log tracking, and various other business scenarios
License MIT
Informations about the package id-generator
🆔 hejunjie/php-id-generator
A lightweight PHP ID generator supporting Snowflake, UUID, timestamp, and custom readable ID strategies. Ensures global uniqueness and high-performance, easily integrable into any PHP project, suitable for order numbers, resource identifiers, log tracking, and various other business scenarios
This project has been parsed by Zread. If you need a quick overview of the project, you can click here to view it:Understand this project
✨ Features
- Generate globally unique IDs: Suitable for order numbers, database primary keys, log tracking, resource identifiers, and other scenarios
- Multi-strategy support: Supports Snowflake, timestamp, UUID, and custom readable IDs to meet different business needs
- High performance & easy integration: Lightweight with no complex dependencies, ideal for quick integration into any PHP project
- Parseable & controllable: Generated IDs can be parsed to extract time, machine, or sequence information, facilitating business analysis
📦 Installation
Install this library using Composer:
🚀 Usage
🎯 Purpose & Motivation
When working on projects, I often encounter the need to generate order numbers, resource IDs, and other globally unique identifiers. Writing separate generation methods for each project works, but as the number of projects increases, maintaining consistency becomes difficult, and different projects have different requirements—some even involve distributed systems.
Therefore, I created this repository with the following goals:
- Lightweight and high-performance PHP ID generator
- Multi-strategy support: Choose between Snowflake, timestamp, UUID, or custom readable IDs according to different business needs
- Easy to use and parseable: Generated IDs ensure global uniqueness while allowing tracking of origin and time
- Minimized dependencies: Quickly integrate into any PHP project, reducing the need to reinvent the wheel
I hope this library can help both myself and other developers, making the generation of unique IDs simpler and more reliable.
🤝 Welcome PRs & Contributions
This project started from personal development needs, but I hope it can become a community-friendly and sustainable tool. If you have good ideas, improvement suggestions, or find any bugs, feel free to submit an Issue or Pull Request.
Whether it's:
- Adding new strategies or algorithms
- Improving performance or optimizing implementations
- Enhancing usability or documentation
All contributions are warmly welcome. Every PR helps make this library better and saves time for developers like me.