3.0.0
The 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.
Added
- Add a number of generators that may be used to override the library defaults
for generating random bytes (version 4) or time-based (version 1) UUIDsCombGenerator
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 7- Refactor time-based (version 1) UUIDs into a
TimeGeneratorInterface
to
allow for other sources to generate version 1 UUIDs in this library PeclUuidTimeGenerator
andPeclUuidRandomGenerator
for creating version
1 or version 4 UUIDs using the pecl-uuid extension
- Add a
setTimeGenerator
method onUuidFactory
to override the default time
generator - Add option to enable
PeclUuidTimeGenerator
viaFeatureSet
- Support GUID generation by configuring a
FeatureSet
to use GUIDs - Allow UUIDs to be serialized as JSON through
JsonSerializable
Changed
- Change root namespace from "Rhumsaa" to "Ramsey;" in most cases, simply
making this change in your applications is the only upgrade path you will
need—everything else should work as expected - No longer consider
Uuid
class asfinal
; 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 dependencies - Return an object of type
DegradedUuid
on 32-bit systems to indicate that
certain features are not available - Default
RandomLibAdapter
to a medium-strength generator with
ircmaxell/random-lib; this is configurable, so other generator strengths may
be used
Removed
- Remove
PeclUuidFactory
in favor of using pecl-uuid with generators - Remove
timeConverter
andtimeProvider
properties, setters, and getters in
bothFeatureSet
andUuidFactory
as those are now exclusively used by the
defaultTimeGenerator
- Move UUID Doctrine field type to ramsey/uuid-doctrine
- Move
uuid
console application to ramsey/uuid-console - Remove
Uuid::VERSION
package version constant
Fixed
- Improve GUID support to ensure that:
- On little endian (LE) architectures, the byte order of the first three
fields is LE - On big endian (BE) architectures, it is the same as a GUID
- String representation is always the same
- On little endian (LE) architectures, the byte order of the first three
- Fix exception message for
DegradedNumberConverter::fromHex()