Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches

UUID-like identifier generator. More...

#include <adobe/zuid.hpp>

Inheritance diagram for zuid_t:

Public Types

enum  { string_size_k }

Public Member Functions

 zuid_t ()
 zuid_t (const zuid_t &)
 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)
zuid_toperator= (const zuid_t &)
zuid_toperator= (const uuid_t &)
std::string str () const
char * c_str () const

Static Public Attributes

static const zuid_t null

Friends

bool operator== (const zuid_t &a, const zuid_t &b)
bool operator< (const zuid_t &a, const zuid_t &b)

(Note that these are not member symbols.)

 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 88 of file zuid.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
string_size_k 

Definition at line 116 of file zuid.hpp.

Constructor & Destructor Documentation

◆ zuid_t() [1/6]

zuid_t ( )

◆ zuid_t() [2/6]

zuid_t ( const zuid_t & )

◆ zuid_t() [3/6]

zuid_t ( const uuid_t & )
explicit

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

◆ zuid_t() [4/6]

zuid_t ( const std::string & )
explicit

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

◆ zuid_t() [5/6]

zuid_t ( const char * )
explicit

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

◆ zuid_t() [6/6]

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

◆ operator=() [1/2]

zuid_t & operator= ( const zuid_t & )

◆ operator=() [2/2]

zuid_t & operator= ( const uuid_t & )

◆ str()

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

◆ c_str()

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

◆ operator==

bool operator== ( const zuid_t & a,
const zuid_t & b )
friend

◆ operator<

bool operator< ( const zuid_t & a,
const zuid_t & b )
friend

◆ uuid_t()

uuid_t
related

UUID-compliant storage for the ZUID

Member Data Documentation

◆ null

const zuid_t null
static

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

Definition at line 113 of file zuid.hpp.