Druuid

Categories

Component ID

1790174

Component name

Druuid

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Overview

This module provides a field for adding universally unique identifiers (UUID) to Drupal entities, called a DRUUID.

It also lets you choose which type of valid RFC 4211 compliant UUID type you would like use, i.e. v3, v4 or v5.

  • Version 3 and 5 UUIDs are named based. They require a namespace (another valid UUID) and a value (the name). Given the same namespace and name, the output is always the same.
  • Version 4 UUIDs are pseudo-random.
  • UUIDs generated below validates using OSSP UUID Tool, and output for named-based UUIDs are exactly the same.

This is a pure PHP implementation see @link http://www.php.net/manual/en/function.uniqid.php#94959

Features

  1. Provides a UUID Field
    - Creates a field that can be attached to drupal entities and bundles
  2. Provides different UUID Types
    - Lets you choose which RFC compliant UUID code to use when generating DRUUIDS.

Usage

Enable the module and within your custom module =>

$my_uuid = druuid_create($version = '4', $namespace = NULL);

* Named-based UUID.
* $v3uuid = DrUUID::v3('1546058f-5a25-4334-85ae-e68f2a44bbaf', 'SomeRandomString');
* $v5uuid = DrUUID::v5('1546058f-5a25-4334-85ae-e68f2a44bbaf', 'SomeRandomString');

* Pseudo-random UUID
* $v4uuid = DrUUID::v4();

The module now also provides an admin screen, in order to apply the field instance to the various entity bundle types within the system.

Requirements

This is currently a Drupal 7 only project, as Drupal 8 will contain it's own UUID component. (according to the current build drupal-8.x-dev)

Download

@see http://drupal.org/project/1790174/git-instructions