A 128-bit value to serve as a universally unique identifier. Two
Uuid
s are equal if they have the same 128-bit value.
Uuid
instances can be created using the static methods of the {@link UuidFactory} class.
The design of this class is intended to support the use of universally unique identifiers that
- have a high likelihood of uniqueness over space and time and
- are computationally difficult to guess.
The second goal is intended to support the treatment of data containing a
Uuid
as a capability. Note that not all defined
Uuid
values imply a generation algorithm that supports this goal.
The most significant 64 bits of the value can be decomposed into unsigned integer fields according to the following bit masks:
0xFFFFFFFF00000000 time_low 0x00000000FFFF0000 time_mid 0x000000000000F000 version 0x0000000000000FFF time_hi
The least significant 64 bits of the value can be decomposed into unsigned integer fields according to the following bit masks:
0xC000000000000000 variant 0x3FFF000000000000 clock_seq 0x0000FFFFFFFFFFFF node
This specification defines the meaning (and implies aspects of the generation algorithm) of Uuid
values if the variant field is 0x2
and the version
field is either 0x1
or 0x4
.
If the version
field is 0x1
, then
If the version
field is 0x4
, then the time_low
, time_mid
, time_hi
, clock_seq
, and node
fields are values that were produced from a cryptographically strong random sequence.
Only Uuid
values with a version
field of 0x4
are considered computationally difficult to guess. A Uuid
value with a version
field of 0x1
should not be treated as a capability.
A subclass of Uuid
must not implement {@link Externalizable}; this restriction is enforced by this class's constructor and readObject
methods.
@author Sun Microsystems, Inc.
@since 2.0