webpatser/uuid
最新稳定版本:v1.3.0
Composer 安装命令:
composer require webpatser/uuid
包简介
A pure PHP library to generate and validate universally unique identifiers (UUIDs) according to RFC 4122 and RFC 9562 standards. Support for UUID versions 1, 3, 4, 5, 6, 7, and 8.
README 文档
README
Blazing fast PHP UUID library leveraging PHP 8.2+ and 8.4 cutting-edge features for maximum performance. 15% faster than Ramsey UUID with modern optimizations.
⚡ Modern PHP Performance Features
Built with the latest PHP innovations for unmatched speed:
- Random\Randomizer (PHP 8.2) - Superior entropy generation
- readonly properties (PHP 8.1+) - Memory optimization and immutability
- hrtime() precision - Nanosecond timestamps with monotonic behavior
- array_is_list() (PHP 8.1) - Optimized array operations
- str_starts_with() / str_ends_with() (PHP 8.0+) - Fast string parsing
- match expressions (PHP 8.0+) - Efficient version dispatching
- PHP 8.3+ hex optimization - Direct hex string generation
- enum backing (PHP 8.1+) - Type-safe constants with zero overhead
Installation
composer require webpatser/uuid
Requirements: PHP 8.2+ (no extensions required)
Quick Start
use Webpatser\Uuid\Uuid; // Generate UUIDs $uuid4 = Uuid::v4(); // Random UUID (recommended) $uuid7 = Uuid::v7(); // Unix timestamp + random (database-optimized) $uuid1 = Uuid::generate(1); // Time-based UUID $uuid5 = Uuid::generate(5, 'hello', Uuid::NS_DNS); // Name-based SHA-1 echo $uuid4; // e.g., "123e4567-e89b-12d3-a456-426614174000"
Documentation
For complete documentation, examples, and API reference, visit:
https://documentation.downsized.nl/uuid
License
MIT License.
统计信息
- 总下载量: 20.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-10