article

A Globally Unique Identifier or GUID is a pseudo-random number used in software applications. While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4028×1038) is so large that the possibility of the same number being generated twice is very small.

GUIDs are used in many pieces of software, including Oracle Database and Novell eDirectory, but the most high-profile GUID implementation may be Microsoft's. There is a standard called Universally Unique Identifier (UUID), specified by the Open Software Foundation (OSF).

Basic structure


The GUID (pronounced gwid (as in Squid) especially by Microsoft; alternate pronunciation goo-id) is a 16-byte (128-bit) number, written in hexadecimal form, such as:

3F 25 04 E0 4F 89 11 D3 9A 0C 03 05 E8 2C 33 01

While a GUID strictly has no formal substructure, they may be written in text in varying ways depending on the implementation. In one such method GUIDs are written using the hexadecimal representation of a four-byte word, 2 two-byte words, and a eight-byte word separate by hyphens, such as:

{3F2504E0-4F89-11D3-9A0C0305E82C3301}

However, the most commonly used structure of the data type is:

GUID STRUCT Data1 dd Data2 dw Data3 dw Data4 db 8 GUID ENDS

The definition of guid from guidef.h is as shown below:

typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data48 ; } GUID;

Using the above structure definitions, a hexadecimal representation could also be:

{3F2504E0-4F89-11D3-9A-0C-03-05-E8-2C-33-01}

In the Microsoft component object model, GUIDs are used to uniquely distinguish different software component interfaces. This means that two (possibly incompatible) versions of a component can have exactly the same name but still be distinguishable by their GUIDs.

GUIDs are also inserted into documents from Microsoft Office programs, as these are regarded as objects as well. Even audio or video streams in the Advanced Streaming Format (ASF) are identified by their GUIDs.

In Advanced Streaming Format (ASF) files at least, and probably in general, the GUID data is stored in little endian format as a 32-bit unsigned integer, followed by 2 16-bit unsigned integers, followed by 8 unsigned bytes. Software on hardware with a big endian CPU must reverse the bytes in the first 32-bit, and both 16-bit quantities, the remaining 8 bytes are fine as is. (The display format is somewhat misleading.)

Algorithm


The OSF-specified algorithm used by Microsoft for generating new GUIDs has been widely criticized. In these (V1) GUIDs, the user's network card MAC address was used as a base for the last group of GUID digits, which meant, for example, that a document could be tracked back to the computer that created it. This privacy hole was used when locating the creator of the Melissa worm.

V1 GUIDs which contain a MAC address can be identified by the digit "1" in the first position of the third group of digits, for example {2f1e4fc0-81fd-11da-9156-00036a0f876a}. GUIDs using the later algorithm, which has a random suffix have a "4" in the same position, for example {38a52be4-9352-453e-af97-5c3b448652f0}.

Subtypes


There are several flavors of GUIDs used in COM:
  • IID - interface identifier;
  • CLSID - class identifier;
  • LIBID - type library identifier;
  • CATID - category identifier; (its presence on a class identifies it as belonging to certain class categories)

DCOM introduces many additional GUID subtypes:

  • AppID - application identifier;
  • MID - machine identifier;
  • IPID - interface pointer identifier; (applicable to an interface engaged in RPC)
  • CID - causality identifier; (applicable to a RPC session)
  • OID - object identifier; (applicable to an object instance)
  • OXID - object exporter identifier; (applicable to an instance of the system object that performs RPC)
  • SETID - ping set identifier; (applicable to a group of objects)

These GUID subspaces may overlap, as the context of GUID usage defines its subtype. For example, there might be a class using same GUID for its CLSID as another class is using for its IID –- all without a problem. On the other hand, two classes using same CLSID couldn't co-exist.

XML syndication formats


There is also a guid tag in some versions of the RSS specification, and mandatory id tag in Atom, which should contain a unique identifier for each individual article or weblog post. In RSS the contents of the guid can be any text, and in practice is typically a copy of the post URL. Atom's IDs need to be valid URIs (usually URLs pointing to the entry, or URNs containing any other unique identifier).

External links


Microsoft Windows | Identifiers

Globally Unique Identifier | Globally Unique Identifier | Globally Unique Identifier | GUID | Globally Unique Identifier | Globálisan egyedi azonosító | Globally Unique Identifier | GUID

 

This article is licensed under the GNU Free Documentation License. It uses material from the "Globally Unique Identifier".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld