All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
As an example, consider the case of timestamp 1 with 600000 microseconds
(1.600000). This is the first second after midnight on January 1, 1970, UTC.
Previous versions of this library had a bug that would round this to 2, so
the rendered time was 1970-01-01 00:00:02. This was incorrect. Despite
having 600000 microseconds, the time should not round up to the next second.
Rather, the time should be 1970-01-01 00:00:01.600000. Since this version of
ramsey/uuid does not support microseconds, the microseconds are dropped, and
the time is 1970-01-01 00:00:01. No rounding should occur.
/sys/class/net/*/address are readable
before attempting to read them. This avoids a PHP warning that was being
emitted on hosts that do not grant permission to read these files.RandomNodeProvider behavior on 32-bit systems. The RandomNodeProvider
was converting a 6-byte string to a decimal number, which is a 48-bit,
unsigned integer. This caused problems on 32-bit systems and has now been
resolved.Ramsey\Uuid namespace.
v1(int|string|null $node = null, int|null $clockSeq = null): stringv3(string|UuidInterface $ns, string $name): stringv4(): stringv5(string|UuidInterface $ns, string $name): stringRandomLibAdapter. This
is a non-breaking change.These will be removed in ramsey/uuid version 4.0.0:
MtRandGenerator, OpenSslGenerator, and SodiumRandomGenerator are
deprecated in favor of using the default RandomBytesGenerator.ext-json as a required dependency in composer.json.PHP_OS instead of php_uname() when determining the system OS, for
cases when php_uname() is disabled for security reasons.glob() returns false when searching
/sys/class/net/*/address files on LinuxDefaultTimeGeneratorrandom_int() from mt_rand() for better random numbersrandom_bytes() when generating random nodesUuid::UUID_TYPE_TIMEUuid::UUID_TYPE_IDENTIFIERUuid::UUID_TYPE_HASH_MD5Uuid::UUID_TYPE_RANDOMUuid::UUID_TYPE_HASH_SHA1str_pad() instead of sprintf()InvalidUuidStringException, which is thrown when attempting to decode an
invalid string UUID; this does not introduce any BC issues, since the new
exception inherits from the previously used InvalidArgumentExceptionstr_pad()
and dechex() instead of sprintf())OrderedTimeCodec to store UUID in an optimized way for InnoDBRandomNodeProviderTimestampFirstCombCodec and TimestampLastCombCodec codecs to provide
the ability to generate COMB sequential UUIDs with the timestamp encoded as
either the first 48 bits or the last 48 bitsCombGenerator for COMB sequential UUIDsRandomBytesGenerator in versions of PHP earlier than 7.0;
this addresses and fixes the collision issueSodiumRandomGenerator to allow use of the PECL libsodium extension as
a random bytes generator when creating UUIDsSerializable interface to provide the ability to
serialize/unserialize UUID objectsThe 3.0.0 release represents a significant step for the ramsey/uuid library. While the simple and familiar API used in previous versions remains intact, this release provides greater flexibility to integrators, including the ability to inject your own number generators, UUID codecs, node and time providers, and more.
Please note: The changelog for 3.0.0 includes all notes from the alpha and beta versions leading up to this release.
CombGenerator to allow generation of sequential UUIDsOpenSslGenerator to generate random bytes on systems where
openssql_random_pseudo_bytes() is presentMtRandGenerator to provide a fallback in the event other random generators
are not presentRandomLibAdapter to allow use of ircmaxell/random-libRandomBytesGenerator for use with PHP 7; ramsey/uuid will default to use
this generator when running on PHP 7TimeGeneratorInterface to
allow for other sources to generate version 1 UUIDs in this libraryPeclUuidTimeGenerator and PeclUuidRandomGenerator for creating version
1 or version 4 UUIDs using the pecl-uuid extensionsetTimeGenerator method on UuidFactory to override the default time
generatorPeclUuidTimeGenerator via FeatureSetFeatureSet to use GUIDsJsonSerializableUuid class as final; everything is now based around
interfaces and factories, allowing you to use this package as a base to
implement other kinds of UUIDs with different dependenciesDegradedUuid on 32-bit systems to indicate that
certain features are not availableRandomLibAdapter to a medium-strength generator with
ircmaxell/random-lib; this is configurable, so other generator strengths may
be usedPeclUuidFactory in favor of using pecl-uuid with generatorstimeConverter and timeProvider properties, setters, and getters in
both FeatureSet and UuidFactory as those are now exclusively used by the
default TimeGeneratoruuid console application to ramsey/uuid-consoleUuid::VERSION package version constantDegradedNumberConverter::fromHex()DegradedNumberConverter::fromHex()TimeGenerator implementationssetTimeGenerator method on UuidFactory to override the default time
generatorPeclUuidTimeGenerator via FeatureSettimeConverter and timeProvider properties, setters, and getters in
both FeatureSet and UuidFactory as those are now exclusively used by the
default TimeGeneratorTimeGeneratorInterface to allow
for other sources to generate version 1 UUIDs in this libraryPeclUuidTimeGenerator and PeclUuidRandomGenerator for creating version
1 or version 4 UUIDs using the pecl-uuid extensionRandomBytesGenerator for use with PHP 7. ramsey/uuid will default to use
this generator when running on PHP 7RandomLibAdapter to a medium-strength generator with
ircmaxell/random-lib; this is configurable, so other generator strengths may
be usedPeclUuidFactory in favor of using pecl-uuid with generatorsUuidFactory and/or extending FeatureSet
to override any package defaultsCombGenerator to allow generation of sequential UUIDsOpenSslGenerator to generate random bytes on systems where
openssql_random_pseudo_bytes() is presentMtRandGenerator to provide a fallback in the event other random generators
are not presentRandomLibAdapter to allow use of ircmaxell/random-libFeatureSet to use GUIDsJsonSerializableUuid class as final; everything is now based around
interfaces and factories, allowing you to use this package as a base to
implement other kinds of UUIDs with different dependenciesDegradedUuid on 32-bit systems to indicate that
certain features are not availableuuid console application to ramsey/uuid-consoleUuid::VERSION package version constantRandomBytesGenerator in versions of PHP earlier than 7.0;
this addresses and fixes the collision issueuuid CLI applicationUuid::calculateUuidTime()passthru() and output buffering in getIfconfig()fromInteger() method to create UUIDs from string integer or
Moontoast\Math\BigNumbergenerateBytes() from foreach to formt_rand used in version 4 UUIDsUuid::VALID_PATTERN constant containing a UUID validation regex patternuuid console application could not find the Composer
autoloader when installed in another projectuuid console application for generating and decoding UUIDs from
CLI (run ./bin/uuid for details)Uuid::getInteger() to retrieve a Moontoast\Math\BigNumber
representation of the 128-bit integer representing the UUIDUuid::getHex() to retrieve the hexadecimal representation of the UUIDnetstat on Linux to capture the node for a version 1 UUIDopenssl_random_pseudo_bytes(), if available, to generate random bytesnull from Uuid::getVersion() if the UUID isn't an RFC 4122 variantUuid::fromString()Uuid::fromBytes()Doctrine\UuidType::requiresSQLCommentHint() methodUuid::isValid() where the NIL UUID was not reported as validUuid::isValid() methodUuid class finalUuid::getLeastSignificantBits() and Uuid::getMostSignificantBits(); the
integers returned by these methods are unsigned 64-bit integers and
unsupported even on 64-bit builds of PHPUnsupportedOperationException to the Exception subnamespacefinal keyword from Uuid class