|
|
|
|
|
- Empty UUID
- UUID format
- Possible conversions
- Available operations
- Comparison
- Generating a UUID
- HFSQL items
- Using UUID types in controls
- COM interface
- Serialization
UUID (Variable type) In french: UUID
The UUID type is used to easily manage: - UUIDs or GUIDs,
- automatic UUID HFSQL identifiers,
- identifiers for COM/Automation objects and interfaces
- etc.
UUID variables are available: - as 128-bit values. 128-bit UUIDs comply with RFC 4122.
- as 256-bit values.
v is UUID
v1 is 128-bit UUID
v2 is 256-bit UUID
Syntax
Declaring and assigning a value to a UUID variable Hide the details
<Variable name> is UUID = <Value> OR
<Variable name> is UUID <Variable name> = <Value>
<Variable name>: Name of the variable to declare. <Value>: Value to be assigned to the variable. The following values can be assigned to a UUID variable: Remarks Empty UUID By default, a UUID variable is empty when it is created. Its value corresponds: - to the constant Nil_UUID for 128-bit UUID variables.
- to the constant Nil_UUID256 for 256-bit UUID variables.
UUID format The UUIDs recognized by WLanguage are: - The official format specified in RFC 9562: "8-4-4-4-12"
- The usual "{8-4-4-12}" (Microsoft notation) and "32" (monobloc) formats.
The main purpose of the conversions is to facilitate debugging and detect unnecessary operations. Values can be converted to strings or buffers, but not to numeric variables. A 128-bit UUID can be converted to: - a standard hexadecimal string, e.g. "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
- a "big-endian" buffer (16 bytes).
A 256-bit UUID can be converted to: - a hexadecimal string, e.g. "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".
- a "big-endian" buffer (32 bytes).
Other conversions are not allowed. For example, a 128-bit UUID cannot be converted to a 256-bit UUID and vice versa. The main purpose of the operations is to facilitate debugging and detect unnecessary operations. String concatenation is allowed, but arithmetic operations are not. A UUID (128-bit or 256-bit) can be concatenated with a string or a buffer. UUIDs can be compared to allow for sorting and binary search in an array. - 128-bit UUIDs can be compared to 128-bit UUIDs, strings and buffers.
- 256-bit UUIDs can be compared to 256-bit UUIDs, strings and buffers.
Generating a UUID A 128-bit UUID can be generated: - with the GetGUID function. Example:
- with the GetUUID function. Example:
A 256-bit UUID can be generated: - with the GetGUID function. Example:
v is UUID on 256 = GetGUID(guidRough256)
- with the GetUUID256 function. Example:
v is UUID on 256 = GetUUID256()
HFSQL items - 128-bit and 256-bit UUID items are available in the analysis.
- 128-bit and 256-bit UUID items can be automatic. In this case, they are automatic UUIDs. A UUID will be automatically generated when HAdd is called.
Using UUID types in controls "UUID" and "256-bit UUID" input and display masks are available for controls that allow these types. Data binding to HFSQL items and UUID variables is allowed. Serialization - 128-bit UUID:
- Serializable in XML and JSON: string in standard "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format
- Serializable in binary: "big-endian" binary format.
- 256-bit UUID:
- Serializable in XML and JSON: string in "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" format
- Serializable in binary: "big-endian" binary format.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|