Package Products :: Package ZenUtils :: Package guid :: Module guid |
[hide private]
[frames] | no frames]

# Module guid

source code

Classes | [hide private]
GlobalIdentifier
GUIDManager
BrainGlobalIdentifier

Functions | [hide private]
generate(uuid_type=4, *args, **kwargs) Generate an Universally Unique ID (UUID), according to RFC 4122. | source code

Variables | [hide private]
| __doc__ = `"""g`...``
| known_uuid_types = `{1: uuid1, 3: uuid3, 4: uuid4, 5: uuid5,}`
| GUID_ATTR_NAME = `'_guid'`
| GUID_TABLE_PATH = `'/zport/dmd/guid_table'`

Function Details | [hide private]

### generate(uuid_type=4, *args, **kwargs) | source code
Generate an Universally Unique ID (UUID), according to RFC 4122. If an unknown uuid_type is provided, uses the UUID4 algorithm.
    >>> guids = [ generate() for x in range(100000) ]
    >>> guid_set = set( guids )
    >>> len(guids) == len(guid_set)
    True
    >>> len( str( generate() ) ) == 36
    True
Parameters: `uuid_type` (range from 0 - 5) - the type of UUID to generate Returns: UUID

Variables Details | [hide private]

  ### __doc__ Value:
      """guid

      Generate a globally unique id that is used for events.
      This is a wrapper around the library that is used in Python 2.5
      and higher.
      See http://zestyping.livejournal.com/157957.html for more info and
      the code is available from http://zesty.ca/python/
      """