Python uuid.uuid5() Examples

The following are 30 code examples of uuid.uuid5(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module uuid , or try the search function .
Example #1
Source Project: datasette   Author: simonw   File: database.py    License: Apache License 2.0 6 votes vote down vote up
def execute_write_fn(self, fn, block=False):
        task_id = uuid.uuid5(uuid.NAMESPACE_DNS, "datasette.io")
        if self._write_queue is None:
            self._write_queue = queue.Queue()
        if self._write_thread is None:
            self._write_thread = threading.Thread(
                target=self._execute_writes, daemon=True
            )
            self._write_thread.start()
        reply_queue = janus.Queue()
        self._write_queue.put(WriteTask(fn, task_id, reply_queue))
        if block:
            result = await reply_queue.async_q.get()
            if isinstance(result, Exception):
                raise result
            else:
                return result
        else:
            return task_id 
Example #2
Source Project: avocado-vt   Author: avocado-framework   File: qcontainer.py    License: GNU General Public License v2.0 6 votes vote down vote up
def dimm_device_define_by_params(self, params, name):
        """
        Create pc-dimm device from params.
        """
        params = params.object_params("dimm")
        dimm_type = "nvdimm" if params.get("nv_backend") else "pc-dimm"
        attrs = qdevices.Dimm.__attributes__[:]
        dev = qdevices.Dimm(params=params.copy_from_keys(attrs),
                            dimm_type=dimm_type)
        dev.set_param("id", "%s-%s" % ("dimm", name))
        if dimm_type == "nvdimm" and params.get("nvdimm_uuid"):
            try:
                dev.set_param("uuid", uuid.UUID(params["nvdimm_uuid"]))
            except ValueError:
                nvdimm_uuid = params["nvdimm_uuid"]
                if nvdimm_uuid == "<auto>":
                    nvdimm_uuid = uuid.uuid5(uuid.NAMESPACE_OID, name)
                dev.set_param("uuid", nvdimm_uuid)
        for ext_k, ext_v in params.get_dict("dimm_extra_params").items():
            dev.set_param(ext_k, ext_v)
        return dev 
Example #3
Source Project: hardware   Author: redhat-cip   File: detect.py    License: Apache License 2.0 6 votes vote down vote up
def _get_uuid_ppc64le(hw_lst):
    vendor = None
    serial = None
    for (_, _, sys_subtype, value) in hw_lst:
        if sys_subtype == 'vendor':
            vendor = value
        if sys_subtype == 'serial':
            serial = value

    system_uuid = None
    system_uuid_fname = '/sys/firmware/devicetree/base/system-uuid'
    if os.access(system_uuid_fname, os.R_OK):
        with open(system_uuid_fname) as uuidfile:
            system_uuid = uuidfile.read().rstrip(' \t\r\n\0')
    elif vendor and serial:
        root = uuid.UUID(bytes=b'\x00' * 16)
        vendor_uuid = uuid.uuid5(root, vendor)
        system_uuid = str(uuid.uuid5(vendor_uuid, serial))

    return system_uuid 
Example #4
Source Project: Blender-Metaverse-Addon   Author: Menithal   File: writer.py    License: GNU General Public License v3.0 6 votes vote down vote up
def set_relative_to_parent(blender_object, json_data):
    if blender_object.parent:
        parent = blender_object.parent
        
        parent_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, parent.name)
        
        parent_orientation = quat_swap_nzy(relative_rotation(blender_object))
        parent_position = swap_nzy(relative_position(blender_object))
        
        json_data["position"] = {
            'x': parent_position.x,
            'y': parent_position.y,
            'z': parent_position.z
        }
        
        json_data["rotation"] = {
            'x': parent_orientation.x,
            'y': parent_orientation.y,
            'z': parent_orientation.z,
            'w': parent_orientation.w
        }
        
        json_data["parentID"] = str(parent_uuid)

    return json_data 
Example #5
Source Project: scapy   Author: secdev   File: volatile.py    License: GNU General Public License v2.0 6 votes vote down vote up
def _fix(self):
        if self.uuid_template:
            return uuid.UUID(("%08x%04x%04x" + ("%02x" * 8))
                             % self.uuid_template)
        elif self.version == 1:
            return uuid.uuid1(self.node, self.clock_seq)
        elif self.version == 3:
            return uuid.uuid3(self.namespace, self.name)
        elif self.version == 4:
            return uuid.uuid4()
        elif self.version == 5:
            return uuid.uuid5(self.namespace, self.name)
        else:
            raise ValueError("Unhandled version")


# Automatic timestamp 
Example #6
Source Project: Fluid-Designer   Author: Microvellum   File: test_uuid.py    License: GNU General Public License v3.0 6 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #7
Source Project: dffml   Author: intel   File: pypi.py    License: MIT License 6 votes vote down vote up
def lookup(self, dependency: Dependency) -> Dependency:
        # Grab the package data from PyPi
        with urllib.request.urlopen(
            f"https://pypi.org/pypi/{dependency.name}/json"
        ) as resp:
            package_json = json.load(resp)
        return Dependency.mkoverride(
            dependency,
            url=package_json["info"]["project_urls"]["Homepage"],
            license=package_json["info"]["license"],
            extra={
                self.name: PyPiDependency(
                    uuid=None,
                    euuid=uuid.uuid5(self.uuid, dependency.name),
                    name=dependency.name,
                    url=f"https://pypi.org/pypi/{dependency.name}",
                    license=package_json["info"]["license"],
                )
            },
        ) 
Example #8
Source Project: ironpython3   Author: IronLanguages   File: test_uuid.py    License: Apache License 2.0 6 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #9
Source Project: TobiiGlassesPyController   Author: ddetommaso   File: controller.py    License: GNU General Public License v3.0 6 votes vote down vote up
def create_participant(self, project_id, participant_name = "DefaultUser", participant_notes = ""):
		participant_id = self.get_participant_id(participant_name)
		self.participant_name = participant_name

		if participant_id is None:
			data = {'pa_project': project_id,
					'pa_info': { 'EagleId': str(uuid.uuid5(uuid.NAMESPACE_DNS, self.participant_name)),
								 'Name': self.participant_name,
								 'Notes': participant_notes},
					'pa_created': self.__get_current_datetime__()}
			json_data = self.__post_request__('/api/participants', data)
			logging.debug("Participant " + json_data['pa_id'] + " created! Project " + project_id)
			return json_data['pa_id']
		else:
			logging.debug("Participant %s already exists ..." % participant_id)
			return participant_id 
Example #10
Source Project: taskcat   Author: aws-quickstart   File: _lambda_build.py    License: Apache License 2.0 6 votes vote down vote up
def _build_lambdas(self, parent_path: Path, output_path):
        if not parent_path.is_dir():
            return
        for path in parent_path.iterdir():
            if (path / "Dockerfile").is_file():
                tag = f"taskcat-build-{uuid5(self.NULL_UUID, str(path)).hex}"
                LOG.info(
                    f"Packaging lambda source from {path} using docker image {tag}"
                )
                self._docker_build(path, tag)
                self._docker_extract(tag, output_path / path.stem)
            elif (path / "requirements.txt").is_file():
                LOG.info(f"Packaging python lambda source from {path} using pip")
                self._pip_build(path, output_path / path.stem)
            else:
                LOG.info(
                    f"Packaging lambda source from {path} without building "
                    f"dependencies"
                )
                self._zip_dir(path, output_path / path.stem) 
Example #11
Source Project: gcblue   Author: gcblue   File: test_uuid.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #12
Source Project: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: test_uuid.py    License: GNU General Public License v3.0 6 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #13
Source Project: medicare-demo   Author: ofermend   File: test_uuid.py    License: Apache License 2.0 6 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #14
Source Project: polyaxon   Author: polyaxon   File: artifacts.py    License: Apache License 2.0 6 votes vote down vote up
def get_artifacts_by_keys(
    run: BaseRun, namespace: uuid.UUID, artifacts: List[V1RunArtifact]
) -> Dict:
    results = {}
    for m in artifacts:
        state = m.state
        if not state:
            if m.is_input:
                state = m.get_state(namespace)
            else:
                state = run.uuid
        elif not isinstance(state, uuid.UUID):
            try:
                state = uuid.UUID(state)
            except (ValueError, KeyError):
                state = uuid.uuid5(namespace, state)
        results[(m.name, state)] = m

    return results 
Example #15
Source Project: biggraphite   Author: criteo   File: metric.py    License: Apache License 2.0 6 votes vote down vote up
def make_metric(name, metadata, created_on, updated_on, read_on):
    """Create a Metric object.

    Args:
      name: metric name.
      metadata: metric metadata.
      created_on: metric creation date.
      updated_on: metric last update date.
      read_on: metric last read date.

    Returns: a Metric object with a valid id.
    """
    encoded_name = encode_metric_name(sanitize_metric_name(name))
    uid = uuid.uuid5(_UUID_NAMESPACE, encoded_name)
    return Metric(
        encoded_name,
        uid,
        metadata,
        created_on=created_on,
        updated_on=updated_on,
        read_on=read_on,
    ) 
Example #16
Source Project: macops   Author: google   File: profiles.py    License: Apache License 2.0 5 votes vote down vote up
def GenerateUUID(payload_id):
  """Generates a UUID for a given PayloadIdentifier.

  This function will always generate the same UUID for a given identifier.

  Args:
    payload_id: str, a payload identifier string (reverse-dns style).

  Returns:
    uuid: str, a valid UUID based on the payload ID.
  """
  return str(uuid.uuid5(uuid.NAMESPACE_DNS, payload_id)).upper() 
Example #17
Source Project: gnocchi   Author: gnocchixyz   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def ResourceUUID(value, creator):
    if isinstance(value, uuid.UUID):
        return value
    if '/' in value:
        raise ValueError("'/' is not supported in resource id")
    try:
        return uuid.UUID(value)
    except ValueError:
        if len(value) <= 255:
            if creator is None:
                creator = "\x00"
            # value/creator must be str (unicode) in Python 3 and str (bytes)
            # in Python 2. It's not logical, I know.
            if six.PY2:
                value = value.encode('utf-8')
                creator = creator.encode('utf-8')
            return uuid.uuid5(RESOURCE_ID_NAMESPACE,
                              value + "\x00" + creator)
        raise ValueError(
            'transformable resource id >255 max allowed characters') 
Example #18
Source Project: endpoints-tools   Author: cloudendpoints   File: start_esp.py    License: Apache License 2.0 5 votes vote down vote up
def generate_service_config_filename(version):
    return str(uuid.uuid5(uuid.NAMESPACE_DNS, str(version)))

# parse xff_trusted_proxy_list 
Example #19
Source Project: briefcase   Author: beeware   File: msi.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def output_format_template_context(self, app: BaseConfig):
        """
        Additional template context required by the output format.

        :param app: The config object for the app
        """
        # WiX requires a 3-element, integer-only version number. If a version
        # triple isn't explicitly provided, generate one by stripping any
        # non-numeric portions from the version number.
        # If there are less than 3 numeric parts, 0s will be appended.
        try:
            version_triple = app.version_triple
        except AttributeError:
            parsed = parsed_version(app.version)
            version_triple = '.'.join(
                ([str(v) for v in parsed.release] + ['0', '0'])[:3]
            )

        # The application needs a unique GUID.
        # This is used to track the application, even if the application
        # name changes. We can generate a default GUID using the bundle
        # and the formal name; but you'll need to manually set this value
        # if you ever change those two keys.
        try:
            guid = app.guid
        except AttributeError:
            # Create a DNS domain by reversing the bundle identifier
            domain = '.'.join([app.app_name] + app.bundle.split('.')[::-1])
            guid = uuid.uuid5(uuid.NAMESPACE_DNS, domain)
            print("Assigning {app.app_name} an application GUID of {guid}".format(
                app=app,
                guid=guid,
            ))

        return {
            'version_triple': version_triple,
            'guid': str(guid),
        } 
Example #20
Source Project: eventsourcing   Author: johnbywater   File: system_test_fixtures.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def create_reservation_id(cls, order_id):
        return uuid5(NAMESPACE_OID, str(order_id)) 
Example #21
Source Project: eventsourcing   Author: johnbywater   File: timebucketedlog.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def make_timebucket_id(
    log_id: UUID, timestamp: Union[Decimal, float], bucket_size: str
) -> UUID:
    d = datetime_from_timestamp(timestamp)

    assert isinstance(d, datetime.datetime)
    if bucket_size.startswith("year"):
        boundary = "{:04}".format(d.year)
    elif bucket_size.startswith("month"):
        boundary = "{:04}-{:02}".format(d.year, d.month)
    elif bucket_size.startswith("day"):
        boundary = "{:04}-{:02}-{:02}".format(d.year, d.month, d.day)
    elif bucket_size.startswith("hour"):
        boundary = "{:04}-{:02}-{:02}_{:02}".format(d.year, d.month, d.day, d.hour)
    elif bucket_size.startswith("minute"):
        boundary = "{:04}-{:02}-{:02}_{:02}-{:02}".format(
            d.year, d.month, d.day, d.hour, d.minute
        )
    elif bucket_size.startswith("second"):
        boundary = "{:04}-{:02}-{:02}_{:02}-{:02}-{:02}".format(
            d.year, d.month, d.day, d.hour, d.minute, d.second
        )
    else:
        raise ValueError("Bucket size not supported: {}".format(bucket_size))
    return uuid5(Namespace_Timebuckets, log_id.hex + "_" + boundary) 
Example #22
Source Project: eventsourcing   Author: johnbywater   File: array.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def create_array_id(self, i, j):
        return uuid5(self.id, str((i, j))) 
Example #23
Source Project: rucio   Author: rucio   File: fts3.py    License: Apache License 2.0 5 votes vote down vote up
def __get_deterministic_id(self, sid):
        """
        Get deterministic FTS job id.

        :param sid: FTS seed id.
        :returns: FTS transfer identifier.
        """
        baseid, voname = self.__get_transfer_baseid_voname()
        if baseid is None or voname is None:
            return None
        root = uuid.UUID(baseid)
        atlas = uuid.uuid5(root, voname)
        jobid = uuid.uuid5(atlas, sid)
        return str(jobid) 
Example #24
Source Project: bob   Author: BobBuildTool   File: VisualStudio.py    License: GNU General Public License v3.0 5 votes vote down vote up
def generateFilters(self):
        items = []
        filters = {}

        def makeFilter(category, uuid, filePath):
            trail = [ category ]
            for i in filePath.relative_to(self.workspacePath).parent.parts:
                uuid = sha1NsUuid(uuid, i)
                trail.append(i)
                name = "\\".join(trail)
                if name not in filters:
                    f = ElementTree.Element("Filter", {"Include" : name})
                    ElementTree.SubElement(f, "UniqueIdentifier").text = "{" + str(uuid) + "}"
                    filters[name] = ElementTree.tostring(f, encoding="unicode")

            return "\\".join(trail)

        if self.headers:
            g = ElementTree.Element("ItemGroup")
            for i in self.headers:
                s = ElementTree.SubElement(g, "ClInclude", {"Include" : str(i)})
                ElementTree.SubElement(s, "Filter").text = makeFilter("Header Files", FILTERS_HEADERS_UUID, i)
            items.append(ElementTree.tostring(g, encoding="unicode"))
        if self.sources:
            g = ElementTree.Element("ItemGroup")
            for i in self.sources:
                s = ElementTree.SubElement(g, "ClCompile", {"Include" : str(i)})
                ElementTree.SubElement(s, "Filter").text = makeFilter("Source Files", FILTERS_SOURCES_UUID, i)
            items.append(ElementTree.tostring(g, encoding="unicode"))
        if self.resources:
            g = ElementTree.Element("ItemGroup")
            for i in self.resources:
                s = ElementTree.SubElement(g, "Text", {"Include" : str(i)})
                ElementTree.SubElement(s, "Filter").text = makeFilter("Resource Files", FILTERS_RESOURCES_UUID, i)
            items.append(ElementTree.tostring(g, encoding="unicode"))

        return FILTERS_TEMPLATE.format(FILTERS="\n".join(f for n,f in sorted(filters.items())),
                                       ITEMS="\n".join(items)) 
Example #25
Source Project: ironpython2   Author: IronLanguages   File: test_uuid.py    License: Apache License 2.0 5 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v) 
Example #26
Source Project: tcex   Author: ThreatConnect-Inc   File: install_json.py    License: Apache License 2.0 5 votes vote down vote up
def update_app_id(json_data):
        """Update to ensure an appId field exists.

        All App should have an appId to uniquely identify the App. this is not intended to be
        used by core to identify an App.  using appId + major Version could be used for unique
        App identification in core in a future release.
        """
        if json_data.get('appId') is None:
            json_data['appId'] = str(
                uuid.uuid5(uuid.NAMESPACE_X500, os.path.basename(os.getcwd()).lower())
            )
        return json_data 
Example #27
Source Project: thenextquant   Author: SimoHaiLiu   File: tools.py    License: MIT License 5 votes vote down vote up
def get_uuid5(str_in):
    """ make a UUID using a SHA-1 hash of a namespace UUID and a name
    @param str_in 输入字符串
    """
    s = uuid.uuid5(uuid.NAMESPACE_DNS, str_in)
    return str(s) 
Example #28
Source Project: pyArango   Author: ArangoDB-Community   File: connection.py    License: Apache License 2.0 5 votes vote down vote up
def reportStart(self, name):
        if self.statsdc != None:
            self.identifier = str(uuid.uuid5(uuid.NAMESPACE_DNS, name))[-6:]
            if self.reportFile != None:
                self.reportFile.write("[%s]: %s\n" % (self.identifier, name))
                self.reportFile.flush()
            self.startTime = datetime.now() 
Example #29
Source Project: aioquant   Author: JiaoziMatrix   File: tools.py    License: MIT License 5 votes vote down vote up
def get_uuid5(str_in):
    """Generate a UUID using a SHA-1 hash of a namespace UUID and a name

    Args:
        str_in: Input string.

    Returns:
        s: UUID5 string.
    """
    uid5 = uuid.uuid5(uuid.NAMESPACE_DNS, str_in)
    s = str(uid5)
    return s 
Example #30
Source Project: BinderFilter   Author: dxwu   File: test_uuid.py    License: MIT License 5 votes vote down vote up
def test_uuid5(self):
        equal = self.assertEqual

        # Test some known version-5 UUIDs.
        for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
                      '886313e1-3b8a-5372-9b90-0c9aee199e5d'),
                     (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
                      '4c565f0d-3f5a-5890-b41b-20cf47701c5e'),
                     (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
                      '1447fa61-5277-5fef-a9b3-fbc6e44f4af3'),
                     (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
                      'cc957dd1-a972-5349-98cd-874190002798'),
                    ]:
            equal(u.variant, uuid.RFC_4122)
            equal(u.version, 5)
            equal(u, uuid.UUID(v))
            equal(str(u), v)