limeq/ids
Composer 安装命令:
composer require limeq/ids
包简介
Unique id number generation and typed-id support
README 文档
README
Lightweight PHP library for generating unique, time-ordered IDs with optional typed token support
Description
limeQ IDs generates compact, URL-safe, time-ordered unique identifiers encoded in Base62. Each ID encodes a millisecond-precision timestamp and a version number into a fixed 16-character string, making IDs both sortable by creation time and inspectable after the fact.
The library provides two layers of functionality. The base Id class handles raw ID generation and timestamp extraction, suitable for any entity that needs a unique identifier. The TypedId class extends this with a token system that prefixes the ID with a 2-character type code and appends an HMAC checksum, producing verifiable, type-safe tokens that can be safely exposed in URLs, APIs or other public-facing contexts. The checksum prevents token forgery and ensures a token cannot be misused as a different entity type.
IDs are generated from a configurable custom epoch (defaulting to January 1, 2026 UTC), keeping the timestamp component compact and relevant for the lifetime of the application.
Features
- 16-character Base62-encoded unique IDs
- Millisecond-precision timestamp embedded in each ID, extractable after generation
- Time-ordered: IDs sort chronologically by default
- Versioned format for future compatibility
- Typed token support with 2-character type codes
- HMAC checksum verification on tokens to prevent forgery and type confusion
- Configurable epoch, checksum length and checksum secret
- No external dependencies beyond PHP's built-in GMP extension
Requirements
- PHP 8.3+
- GMP extension (
php-gmp)
Installation
composer require limeq/ids
Usage
See the full documentation for details.
Development
See the source on GitLab: https://gitlab.com/limeq/ids.
Contribution Guidelines
If you have suggestions or would like to help contribute to this project, please contact me.
If this project has been helpful, you can support ongoing development at:
Buy Me a Coffee
Authors
Version History
See CHANGELOG.md
License
This project is licensed under the BSD 3-Clause License:
See the LICENSE file for details.
Contact
Please reach out through the project's website:
limeq/ids 适用场景与选型建议
limeq/ids 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「id」 「ids」 「limeq」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 limeq/ids 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 limeq/ids 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 limeq/ids 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Hashids for Yii2
Backend Optimizing Bundle
Provides hash tools for Laravel.
♺ Laravel Nova Hashids card. Convert your ids.
Bundle for https://ids.host/
Alfabank REST API integration
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-02-23