UUID class

提供通用唯一识别码(universally unique identifier)(UUID)实现,UUID表示一个128位的值。

这些通用标识符具有不同的变体。此类的方法用于操作 Leach-Salz 变体,不过构造方法允许创建任何 UUID 变体(将在下面进行描述)。

变体 2 (Leach-Salz) UUID 的布局如下: int 型数据的最高有效位由以下无符号字段组成:

0xFFFFFFFF00000000 time_low
0x00000000FFFF0000 time_mid
0x000000000000F000 version
0x0000000000000FFF time_hi

int 型数据的最低有效位由以下无符号字段组成:

0xC000000000000000 variant
0x3FFF000000000000 clock_seq
0x0000FFFFFFFFFFFF node

variant 字段包含一个表示 UUID 布局的值。以上描述的位布局仅在 UUID 的 variant 值为 2(表示 Leach-Salz 变体)时才有效。 *

version 字段保存描述此 UUID 类型的值。有 4 种不同的基本 UUID 类型:基于时间的 UUID、DCE 安全 UUID、基于名称的 UUID 和随机生成的 UUID。
这些类型的 version 值分别为 1、2、3 和 4。

Implemented types

Constructors

UUID(List<int> ints)
UUID.bits(int mostSigBits, int leastSigBits)
使用指定的数据构造新的 UUID。

Properties

clockSequence int
与此 UUID 相关联的时钟序列值。
no setter
hashCode int
The hash code for this object.
no setterinherited
leastSigBits int
此UUID的最低64有效位
latefinal
mostSigBits int
此UUID的最高64有效位
latefinal
node int
与此 UUID 相关的节点值。
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp int
no setter
variant int
与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。
no setter
version int
与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。
no setter

Methods

compareTo(UUID val) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
返回此{@code UUID} 的字符串表现形式。
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

randomUUID([bool isSecure = true]) UUID
获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。