vjik/uuid

UUID 辅助工具

dev-master 2021-01-03 13:09 UTC

This package is auto-updated.

Last update: 2024-08-29 05:43:41 UTC


README

Latest Stable Version Total Downloads Build status Mutation testing badge static analysis

该包提供了 UuidHelper,它具有用于操作 UUID 的静态方法。基于库 ramsey/uuid

安装

可以使用 composer 安装此包

composer require vjik/uuid --prefer-dist

UuidHelper 使用

UuidHelper 方法是静态的,因此使用方式如下

$bytes = \Vjik\Uuid\UuidHelper::convertStringToBytes('1f2d3897-a226-4eec-bd2c-d0145ef25df9');

该辅助工具总共有以下方法

  • generateTimestampFirstCombUuid4
  • convertStringToBytes
  • convertBytesToString

测试

单元测试

该包使用 PHPUnit 进行测试。要运行测试

./vendor/bin/phpunit

突变测试

该包的测试使用 Infection 突变框架和 Infection 静态分析插件 进行检查。要运行它

./vendor/bin/roave-infection-static-analysis-plugin

静态分析

代码使用 Psalm 进行静态分析。要运行静态分析

./vendor/bin/psalm

许可证

UUID 辅助工具是免费软件。它根据 BSD 许可证条款发布。有关更多信息,请参阅 LICENSE