mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Added methods for creating 7 and 8 versions of UUID to the UuidFactoryInterface
This commit is contained in:
@@ -179,4 +179,34 @@ interface UuidFactoryInterface
|
||||
* version 6 UUID
|
||||
*/
|
||||
public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface;
|
||||
|
||||
/**
|
||||
* Returns a version 7 (Unix Epoch time) UUID
|
||||
*
|
||||
* @param DateTimeInterface|null $dateTime An optional date/time from which
|
||||
* to create the version 7 UUID. If not provided, the UUID is generated
|
||||
* using the current date/time.
|
||||
*
|
||||
* @return UuidInterface A UuidInterface instance that represents a
|
||||
* version 7 UUID
|
||||
*/
|
||||
public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface;
|
||||
|
||||
/**
|
||||
* Returns a version 8 (Custom) UUID
|
||||
*
|
||||
* The bytes provided may contain any value according to your application's
|
||||
* needs. Be aware, however, that other applications may not understand the
|
||||
* semantics of the value.
|
||||
*
|
||||
* @param string $bytes A 16-byte octet string. This is an open blob
|
||||
* of data that you may fill with 128 bits of information. Be aware,
|
||||
* however, bits 48 through 51 will be replaced with the UUID version
|
||||
* field, and bits 64 and 65 will be replaced with the UUID variant. You
|
||||
* MUST NOT rely on these bits for your application needs.
|
||||
*
|
||||
* @return UuidInterface A UuidInterface instance that represents a
|
||||
* version 8 UUID
|
||||
*/
|
||||
public function uuid8(string $bytes): UuidInterface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user