php-extended / php-uuid-object
php-uuid-interface 库的实现
7.0.6
2024-07-31 13:29 UTC
Requires
Requires (Dev)
- dev-master
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.0.7
- 6.0.6
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.1
- 5.0.0
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.4.10
- 3.4.9
- 3.4.8
- 3.4.7
- 3.4.6
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.18
- 3.2.17
- 3.2.16
- 3.2.15
- 3.2.14
- 3.2.13
- 3.2.12
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.0
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-08-31 11:37:31 UTC
README
php-uuid-interface 库的实现
安装
此库的安装通过 composer 完成,所有类的自动加载都通过它们的自动加载器完成。
- 从官方网站下载
composer.phar
。 - 然后运行以下命令以将此库作为依赖项安装
php composer.phar require php-extended/php-uuid-object ^7
基本用法
此库可以使用以下方式使用
use PhpExtended\Uuid\Uuid;
$uuid = new Uuid(0x01234567, 0x89ab, 0xcdef, 0xfe, 0xdc, 0xba9876, 0x543210);
$uuid->__toString(); // 01234567-89ab-cdef-fedc-ba9876543210
解析 uuid
use PhpExtended\Uuid\UuidParser;
$parser = new UuidParser();
$uuid = $parser->parse('<put here your uuid string>');
// $uuid instanceof UuidInterface
按需创建 uuid,请执行
use PhpExtended\Uuid\UuidV4Factory();
$factory = new UuidV4Factory();
$uuid = $factory->create(); // 5F935265-8863-4672-FAB9-27097EF73660
许可证
MIT(见许可证文件)。