Skip to content

Guid

Windows globally unique identifier mirroring the native GUID fields.

Constructor

Guid value

Parses canonical GUID text or binary, or copies an existing Guid.

Binary values use the 16-byte native Windows in-memory layout.

Parameters

NameTypeDescription
value (Str | Bin | Guid) GUID text, binary form, or Guid.

Errors

DataError if the text is invalid or bytes are not exactly 16 long.

Example

let id = Guid "00112233-4455-6677-8899-aabbccddeeff"
let copy = Guid $id

Class Fields

NIL @ Guid [get, set]

The nil Guid, 00000000-0000-0000-0000-000000000000.

Class Methods

generate() -> Guid

Generates a random Guid.

Fields

bytes @ Bin [get]

The 16-byte binary form Windows uses for a GUID.

data1 @ Int [get]

The Data1 field.

data2 @ Int [get]

The Data2 field.

data3 @ Int [get]

The Data3 field.

data4 @ Bin [get]

The 8-byte Data4 field.

Methods

(eq) other -> Bool

Compares two GUID values.

Parameters

NameTypeDescription
other Value

(lt) other -> Bool

Orders two GUID values.

Parameters

NameTypeDescription
other Guid

(str)() -> Str

Returns the canonical hyphenated GUID text.