OScript API/Built-in Package Index

Class: GUID

The GUID package provides services for manipulating globally unique identifiers (GUIDs). The major functionalities offered in the GUID package are the following:

Class Attributes

Specifies a value of type GUID.

Class Methods

Creates a new, random GUID.

FromBytes( Bytes bytesValue )

Creates a new GUID value from a Bytes array.

FromString( String strValue )

Creates a new GUID value from a String.

ToBytes( GUID guidValue )

Convert a GUID value to its Bytes representation.

ToString( GUID guidValue )

Creates a String value from a GUID.

Instance Methods

Convert a GUID value to its Bytes representation.

Creates a String value from a GUID.

Class Attributes

Integer GUIDType

Specifies a value of type GUID.

Class Methods

CreateRandom

GUID CreateRandom()

Creates a new, random GUID. This is a version 4 UUID as described in RFC 4122, section 4.4.

Returns:

A randomly generated identifier.

FromBytes

GUID FromBytes( Bytes bytesValue )

Creates a new GUID value from an array of Bytes. A GUID consists of 16 bytes of data.

Parameters

bytesValue

The value to convert

Returns:

The GUID value created from the Bytes.

FromString

GUID FromString( String strValue )

Creates a new GUID value from a String.

The string representation of a GUID begins with '@[' and ends with ']', and consists of 32 digits separated by hyphens:

@[00000000-0000-0000-0000-000000000000]

Parameters

strValue

The value to convert

Returns:

The GUID value created from the String.

ToBytes

Bytes ToBytes( GUID guidValue )

Convert a GUID value to its Bytes representation. A GUID consists of 16 bytes of data.

Parameters

guidValue

The value to convert

Returns:

Bytes representation of the GUID.

ToString

String ToString( GUID guidValue )

Creates a new String value from a GUID.

The string representation of a GUID begins with '@[' and ends with ']', and consists of 32 digits separated by hyphens:

@[00000000-0000-0000-0000-000000000000]

Parameters

guidValue

The value to convert

Returns:

The String representation of the GUID value.

Instance Methods

ToBytes

Bytes ToBytes()

Convert a GUID value to its Bytes representation. A GUID consists of 16 bytes of data.

Returns:

Bytes representation of the GUID.

ToString

String ToString()

Creates a new String value from a GUID. The string representation of a GUID begins with '@[' and ends with ']', and consists of 32 digits separated by hyphens:

@[00000000-0000-0000-0000-000000000000]

Returns:

The String representation of the GUID value.

 Copyright © 2021 OpenText Corporation. All rights reserved.