stlab.adobe.com Adobe Systems Incorporated

#include <adobe/zuid.hpp>

Public Member Functions

char * c_str () const
 
std::string str () const
 
 zuid_t (const uuid_t &)
 
 zuid_t (const std::string &)
 
 zuid_t (const char *)
 
 zuid_t (const zuid_t &name_space, const std::string &name)
 

Static Public Attributes

static const zuid_t null
 

Related Functions

(Note that these are not member functions.)

 uuid_t
 

Detailed Description

Model Of:

The ZUID class implements a non-standard UUID (Universally Unique ID). The ZUID is generated with an algorithm based on one available from the Open Software Foundation, but with the following differences:

  • The Ethernet hardware address is never imbedded into the ZUID. Instead a "multi-cast" address is generated from random and unique information available on the machine using the RSA Data Security, Inc. MD5 Message-Digest Algorithm (MD5).
  • The address is regenerated with each launch of the application and is not stored persistently.
  • No effort is made to share the address across processes.
  • Instead of using locks to keep processes from generating the same ID at the same time, some process specific information is used in the address.
  • Performance is improved by only checking the system clock at the clocks resolution and not throttling to the clock but rather allowing time to "race ahead" and re-synchronize with the clock when it has caught up.

These changes where made to improve performance and avoid privacy issues of having a hardware specific address imbedded in documents. These changes increase the probability of generating colliding IDs but the probability is low enough to suffice non-mission critical needs.

The UUID code in this file has been significantly altered (as described above) and should not be used where a true UUID is needed. The MD5 code has only been altered for coding standards. The algorithm should still function as originally intended.

See also

Definition at line 89 of file zuid.hpp.

Constructor & Destructor Documentation

◆ zuid_t() [1/4]

zuid_t ( const uuid_t )
explicit

Set this zuid to be the UUID. The UUID isn't changed

◆ zuid_t() [2/4]

zuid_t ( const std::string &  )
explicit

Parses strings of the style "d46f246c-c61b-3f98-83f8-21368e363c36" and constructs the zuid with it

◆ zuid_t() [3/4]

zuid_t ( const char *  )
explicit

Parses strings of the style "d46f246c-c61b-3f98-83f8-21368e363c36" and constructs the zuid with it

◆ zuid_t() [4/4]

zuid_t ( const zuid_t name_space,
const std::string &  name 
)

Create a dependent zuid_t. Given an identical string and zuid_t it will always generate the same new zuid_t. This is useful if you have an object that has a unique name and you want to be able to get an ID for it given the ID of the parent object. The zuid_t is generated by running name_space and name (as UNICODE or ASCII) through MD5.

Member Function Documentation

◆ c_str()

const char * c_str ( ) const
Returns
a formatted string containing the zuid in the form 00000000-0000-0000-0000-000000000000
Note
The return value will remain unique to this thread until this function is called again

◆ str()

std::string str ( ) const
Returns
a formatted string containing the zuid in the form 00000000-0000-0000-0000-000000000000

Friends And Related Function Documentation

◆ uuid_t()

uuid_t
related

UUID-compliant storage for the ZUID

Member Data Documentation

◆ null

null
static

Always set to the null zuid 00000000-0000-0000-0000-000000000000

Definition at line 114 of file zuid.hpp.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google