vjik/uuid

UUID Helper

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

This package is auto-updated.

Last update: 2024-10-29 06:06:06 UTC


README

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

The package provides UuidHelper that has static methods to work with UUID. Based on library ramsey/uuid.

Installation

The package could be installed with composer:

composer require vjik/uuid --prefer-dist

UuidHelper usage

UuidHelper methods are static so usage is like the following:

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

Overall the helper has the following methods:

  • generateTimestampFirstCombUuid4
  • convertStringToBytes
  • convertBytesToString

Testing

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:

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

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

License

The UUID Helper is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.