Page MenuHomeDevCentral

Implement UUIDv1 UUIDv6 UUIDv7 and UUIDv8
ClosedPublic

Authored by dereckson on Apr 10 2022, 09:38.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 07:29
Unknown Object (File)
Tue, Nov 19, 02:09
Unknown Object (File)
Tue, Nov 19, 01:15
Unknown Object (File)
Mon, Nov 18, 08:51
Unknown Object (File)
Mon, Nov 18, 08:35
Unknown Object (File)
Sat, Nov 16, 05:48
Unknown Object (File)
Wed, Nov 13, 01:02
Unknown Object (File)
Tue, Nov 12, 04:02
Subscribers
None

Details

Summary

There is currently a proposal for new UUID to address concerns,
and create identifiers suitable for database purpose as primary key.

This change implements UUIDv6, UUIDv7 and UUIDv8 from that proposal.

Allow to convert back and forth between UUIDv1 and UUIDv6.

Allow to represent timestamps for UUIDv1/UUIDv6 or UUIDv7.

Allow to determine version and variant from a UUID.

References:

  • RFC 4122 for UUIDv1
  • I-D draft-peabody-dispatch-new-uuid-format-03 for UUIDv6 UUIDv7 UUIDv8

Ref T1717.

Test Plan

Full coverage of added code by unit tests.

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Errors
SeverityLocationCodeMessage
Erroromnitools/src/Collections/BaseVector.php:136PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/DateTime/UUIDv7TimeStamp.php:30PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/DateTime/UUIDv7TimeStamp.php:73PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/Random.php:146PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:42PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:43PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:70PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:136PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:137PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/src/Identifiers/UUID.php:164PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Erroromnitools/tests/Identifiers/UUIDTest.php:64PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Warningomnitools/src/DateTime/UUIDv1TimeStamp.php:125PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/Random.php:139PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:25PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:262PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:297PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:301PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:305PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/src/Identifiers/UUID.php:335PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/tests/Identifiers/UUIDTest.php:228PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
Warningomnitools/tests/Identifiers/UUIDTest.php:228PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/tests/Identifiers/UUIDTest.php:235PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
Warningomnitools/tests/Identifiers/UUIDTest.php:235PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/tests/Identifiers/UUIDTest.php:251PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
Warningomnitools/tests/Identifiers/UUIDTest.php:256PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
Unit
Test Failures
Branch
uuid
Build Status
Buildable 4172
Build 4424: arc lint + arc unit