Common subdirectories: uuid_old/translations and uuid/translations
diff -up uuid_old/uuid.admin.inc uuid/uuid.admin.inc
--- uuid_old/uuid.admin.inc	2010-09-08 17:07:14.000000000 +0100
+++ uuid/uuid.admin.inc	2010-10-08 11:39:35.000000000 +0100
@@ -79,6 +79,23 @@ function uuid_admin() {
     ),
     '#description' => t('Should UUIDs be created automatically for comments?'),
   );
+  
+  $gen_method_options = array();
+  if ($GLOBALS['db_type'] != 'pgsql' || function_exists('uuid_create')) {
+    $gen_method_options['universal'] = t('Globally unique, optically similar');
+  }
+  $gen_method_options['optical'] = t('Locally unique, optically distinct');
+  
+  $form['method'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('UUID generation method'),
+  );
+  $form['method']['uuid_generation_method'] = array(
+    '#type' => 'radios',
+    '#title' => t('Select the UUID generation method'),
+    '#default_value' => variable_get('uuid_generation_method', uuid_default_generation_method()),
+    '#options' => $gen_method_options,
+  );
 
   $form['settings'] = array(
     '#type' => 'fieldset',
diff -up uuid_old/uuid.install uuid/uuid.install
--- uuid_old/uuid.install	2010-09-30 21:58:01.000000000 +0100
+++ uuid/uuid.install	2010-10-08 11:37:58.000000000 +0100
@@ -78,6 +78,7 @@ function uuid_uninstall() {
   variable_del('uuid_automatic_for_users');
   variable_del('uuid_automatic_for_taxonomy');
   variable_del('uuid_automatic_for_comments');
+  variable_del('uuid_generation_method');
 
   // Remove tables.
   drupal_uninstall_schema('uuid');
diff -up uuid_old/uuid.module uuid/uuid.module
--- uuid_old/uuid.module	2010-09-24 06:08:07.000000000 +0100
+++ uuid/uuid.module	2010-10-08 11:40:32.000000000 +0100
@@ -249,6 +249,16 @@ function uuid_is_valid($uuid) {
 }
 
 /**
+ * Selects the default UUID generation method based on predefined priorities and availability of packages.
+ */
+function uuid_default_generation_method() {
+  if ($GLOBALS['db_type'] != 'pgsql' || function_exists('uuid_create')) {
+    return 'universal';
+  }
+  return 'optical';
+}
+
+/**
  * Generate and return an Universally Unique IDentifier (UUID).
  *
  * @see http://www.ietf.org/rfc/rfc4122.txt
@@ -258,30 +268,37 @@ function uuid_is_valid($uuid) {
  *   An UUID, made up of 32 hex digits and 4 hyphens.
  */
 function uuid_uuid() {
-  // If we're not using postgres, the database will give us a UUID.
-  if ($GLOBALS['db_type'] != 'pgsql') {
-    return db_result(db_query('SELECT UUID()'));
-  }
+  $generation_method = variable_get('uuid_generation_method', uuid_default_generation_method());
+  switch ($generation_method) {
+    case 'universal':
+      // If we're not using postgres, the database will give us a UUID.
+      if ($GLOBALS['db_type'] != 'pgsql') {
+        return db_result(db_query('SELECT UUID()'));
+      }
 
-  // If the function provided by the uuid pecl extension is available, use that.
-  if(function_exists('uuid_create')) {
-    return uuid_create(UUID_TYPE_DEFAULT);
+      // If the function provided by the uuid pecl extension is available, use that.
+      if(function_exists('uuid_create')) {
+        return uuid_create(UUID_TYPE_DEFAULT);
+      }
+      break;
+      
+    case 'optical':
+      // Fall back to generating a Universally Unique IDentifier version 4.
+      // Base on http://php.net/manual/en/function.uniqid.php#65879
+      // The field names refer to RFC 4122 section 4.1.2.
+      return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x',
+        // 32 bits for "time_low".
+        mt_rand(0, 65535), mt_rand(0, 65535),
+        // 16 bits for "time_mid".
+        mt_rand(0, 65535),
+        // 12 bits before the 0100 of (version) 4 for "time_hi_and_version".
+        mt_rand(0, 4095),
+        bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)),
+        // 8 bits, the last two of which (positions 6 and 7) are 01, for "clk_seq_hi_res"
+        // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d)
+        // 8 bits for "clk_seq_low" 48 bits for "node".
+        mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)
+      );
+      break;
   }
-
-  // Fall back to generating a Universally Unique IDentifier version 4.
-  // Base on http://php.net/manual/en/function.uniqid.php#65879
-  // The field names refer to RFC 4122 section 4.1.2.
-  return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x',
-    // 32 bits for "time_low".
-    mt_rand(0, 65535), mt_rand(0, 65535),
-    // 16 bits for "time_mid".
-    mt_rand(0, 65535),
-    // 12 bits before the 0100 of (version) 4 for "time_hi_and_version".
-    mt_rand(0, 4095),
-    bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)),
-    // 8 bits, the last two of which (positions 6 and 7) are 01, for "clk_seq_hi_res"
-    // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d)
-    // 8 bits for "clk_seq_low" 48 bits for "node".
-    mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)
-  );
 }
