|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
| {{multiple issues|
| | Dalton is what's written from his birth certificate remember, though , he never really treasured that name. His friends say it's no real for him but the text he loves doing happens to be acting and he's been doing doing it for much too long. In my professional life he is certainly a filing assistant and his salary has been recently really [http://answers.yahoo.com/search/search_result?p=fulfilling&submit-go=Search+Y!+Answers fulfilling]. His wife and the [http://www.Bbc.co.uk/search/?q=dog+live dog live] in Idaho though he needs to tactic because of his family. Go to his website much more out more: http://prometeu.net<br><br> |
| {{citation style|date=May 2013}}
| |
| {{refimprove|date=April 2013}}
| |
| {{more footnotes|date=April 2013}}
| |
| }}
| |
| A '''universally unique identifier''' ('''UUID''') is an identifier standard used in [[software]] construction, standardized by the [[Open Software Foundation]] (OSF) as part of the [[Distributed Computing Environment]] (DCE).
| |
|
| |
|
| The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. In this context the word unique should be taken to mean "practically unique" rather than "guaranteed unique". Since the identifiers have a finite size, it is possible for two differing items to share the same identifier. The identifier size and generation process need to be selected so as to make this sufficiently improbable in practice. Anyone can create a UUID and use it to identify something with reasonable confidence that the same identifier will never be unintentionally created by anyone to identify something else. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve identifier (ID) conflicts.
| | Also visit my site; [http://prometeu.net clash of clans cheat] |
| | |
| UUIDs were originally used in the Apollo [[Network Computing System]] and later in the [[Open Software Foundation]]'s (OSF) [[Distributed Computing Environment]] (DCE), and then in Microsoft Windows platforms as [[globally unique identifier]]s (GUIDs). Other significant uses include [[ext2]]/[[ext3]]/[[ext4]] filesystem userspace tools ([[e2fsprogs]] uses libuuid provided by [[util-linux]]), [[LUKS]] encrypted partitions, [[GNOME]], [[KDE]], and [[Mac OS X]],<ref>[http://www.opensource.apple.com/source/Libc/Libc-391/uuid/uuidsrc/gen_uuid.c gen_uuid.c in Apple's Libc-391, corresponding to Max OS X 10.4]</ref> most of which either use the libuuid library now provided by the [[util-linux]] package or implementations derived from it or from the original implementation by Theodore Ts'o in the [[e2fsprogs]]<ref>[http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=blob;f=lib/uuid/gen_uuid.c;hb=1bbfec624c4bbe767060a13762aa9a656536a4fd gen_uuid.c in e2fsprogs]</ref> package (the latter has been moved to the [[util-linux]]<ref>[http://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/libuuid/src/gen_uuid.c gen_uuid.c in util-linux]</ref> package in version 2.15.1<ref>[http://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/libuuid/man/uuid.3 according to util-linux's man 3 uuid manual page, section AVAILABILITY]</ref> for consistency).
| |
| | |
| UUIDs are documented as part of [[International Organization for Standardization|ISO]]/[[International Electrotechnical Commission|IEC]] 11578:1996 "[[Information technology]] – [[Open Systems Interconnection]] – [[Remote Procedure Call]] (RPC)" and more recently in [http://www.itu.int/ITU-T/studygroups/com17/oid.html ITU-T Rec. X.667] | [[International Organization for Standardization|ISO]]/[[International Electrotechnical Commission|IEC]] 9834-8:2005. The [[Internet Engineering Task Force|IETF]] has published the Standards-Track, ''RFC 4122,'' that is technically equivalent with ITU-T Rec. X.667 | ISO/IEC 9834-8.
| |
| | |
| ==Definition==
| |
| A UUID is a 16-[[Octet (computing)|octet]] (128-[[bit]]) number. In its [[canonical form]], a UUID is represented by 32 [[hexadecimal]] digits, displayed in five groups separated by hyphens, in the form <code>8-4-4-4-12</code> for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:
| |
| | |
| :<code>'''550e8400-e29b-41d4-a716-446655440000'''</code>
| |
| | |
| The first 3 sequences are interpreted as complete hexadecimal numbers, while the final 2 as a plain sequence of bytes. The [[byte order]] is ''"Most Significant Byte first (known as network byte order)"''<ref name="rfc4122">{{cite web|url=http://tools.ietf.org/html/rfc4122|title=RFC 4122 - A Universally Unique IDentifier (UUID) URN Namespace|author=P. Leach et al.|date=July 2005|publisher=Internet Engineering Task Force}}</ref><sup>(sec. 4.1.2)</sup> (note that [[GUID]]'s byte order [[Globally_unique_identifier#Binary_encoding|is different]]). This form is defined in the RFC<ref name="rfc4122"/><sup>(sec. 3)</sup> and simply reflects UUID's division into fields<ref name="rfc4122"/><sup>(sec. 4.1.2)</sup> which apparently originates from the structure of the [[#Version 1 (MAC address)|initial time and MAC-based version]].
| |
| | |
| The number of possible UUIDs is 340,282,366,920,938,463,463,374,607,431,768,211,456 (16<sup>32</sup> or 2 <sup>128</sup>), or about 3.4 × 10<sup>38</sup>.
| |
| | |
| ==Variants and versions==
| |
| The '''variant''' indicates the layout of the UUID. The UUID specification covers one particular ''variant''. Other ''variants'' are reserved or exist for backward compatibility reasons (e.g., for values assigned before the UUID specification was produced). An example of a UUID that is a different ''variant'' is the nil UUID, which is a UUID that has all 128 bits set to zero.
| |
| | |
| In the canonical representation, <code>xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx</code>, the most significant bits of <code>N</code> indicates the ''variant'' (depending on the ''variant''; one, two, or three bits are used). The ''variant'' covered by the UUID specification is indicated by the two most significant bits of <code>N</code> being <code>1 0</code> (i.e., the hexadecimal <code>N</code> will always be <code>8</code>, <code>9</code>, <code>A</code>, or <code>B</code>).
| |
| | |
| The ''variant'' covered by the UUID specification has five '''versions'''. For this ''variant'', the four bits of <code>M</code> indicates the UUID ''version'' (i.e., the hexadecimal <code>M</code> will be either 1, 2, 3, 4, or 5).
| |
| | |
| ===Version 1 (MAC address)===
| |
| Conceptually, the original (version 1) generation scheme for UUIDs was to concatenate the UUID version with the [[MAC address]] of the computer that is generating the UUID, and with the number of 100-[[nanosecond]] intervals since the adoption of the [[Gregorian calendar]] in the West. This scheme has been criticized in that it is not sufficiently "opaque"; it reveals both the identity of the computer that generated the UUID and the time at which it did so. Its uniqueness across computers is guaranteed so long as MAC addresses are not duplicated (as can happen, for instance, via manual setting of the MAC address); however, given the speed of modern processors, successive invocations on the same machine of a naive implementation of a generator of version 1 UUIDs may produce the same UUID, violating the uniqueness property. (Non-naive implementations can avoid this problem by, for example, remembering the most recently generated UUID, "pocketing" unused UUIDs, and using pocketed UUIDs in case a duplicate is about to be generated.)
| |
| | |
| ===Version 2 (DCE Security)===
| |
| Version 2 UUIDs are similar to Version 1 UUIDs, with the first 4 bytes of the timestamp replaced by the user's POSIX [[User identifier|UID]] or [[Group identifier (Unix)|GID]] (with the "local domain" identifier indicating which it is) and the upper byte of the clock sequence replaced by the identifier for a "local domain" (typically either the "[[POSIX]] UID domain" or the "POSIX GID domain").<ref>{{cite web
| |
| | author = The Open Group
| |
| | year = 1997
| |
| | title = CDE 1.1: Remote Procedure Call
| |
| | url = http://www.opengroup.org/onlinepubs/9629399/apdxa.htm}}</ref><ref>{{cite web
| |
| | author = The Open Group
| |
| | year = 1997
| |
| | title = DCE 1.1: Authentication and Security Services
| |
| | url = http://www.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01}}</ref>
| |
| | |
| ===Version 3 (MD5 hash)===
| |
| Version 3 UUIDs use a scheme deriving a UUID via [[MD5]] from a [[Uniform Resource Locator|URL]], a
| |
| [[fully qualified domain name]], an [[object identifier]], a distinguished name ([[X.500|DN]] as used in [[Lightweight Directory Access Protocol]]), or on names in
| |
| unspecified namespaces. Version 3 UUIDs have the form <code>xxxxxxxx-xxxx-'''3'''xxx-'''y'''xxx-xxxxxxxxxxxx</code> where <code>x</code> is any hexadecimal digit and <code>y</code> is one of <code>8</code>, <code>9</code>, <code>A</code>, or <code>B</code>.
| |
| | |
| To determine the version 3 UUID of a given name, the UUID of the namespace (e.g., <code>6ba7b810-9dad-11d1-80b4-00c04fd430c8</code> for a domain) is transformed to a string of bytes corresponding to its hexadecimal digits, concatenated with the input name, hashed with MD5 yielding 128 bits. Six bits are replaced by fixed values, four of these bits indicate the version, <code>0011</code> for version 3. Finally, the fixed hash is transformed back into the hexadecimal form with hyphens separating the parts relevant in other UUID versions.
| |
| | |
| ===Version 4 (random)===
| |
| Version 4 UUIDs use a scheme relying only on [[random number generation|random number]]s. This algorithm sets the version number (4 bits) as well as two reserved bits. All other bits (the remaining 122 bits) are set using a random or pseudorandom data source. Version 4 UUIDs have the form <code>xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx</code> where <code>x</code> is any hexadecimal digit and <code>y</code> is one of <code>8</code>, <code>9</code>, <code>A</code>, or <code>B</code> (e.g., <code>f47ac10b-58cc-'''4'''372-'''a'''567-0e02b2c3d479</code>).
| |
| | |
| ===Version 5 (SHA-1 hash)===
| |
| Version 5 UUIDs use a scheme with [[SHA-1]] hashing; otherwise it is the same idea as in version 3. RFC 4122 states that version 5 is preferred over [[#Version 3 (MD5 hash)|version 3]] name based UUIDs, as [[MD5#Security|MD5's security has been compromised]]. Note that the 160 bit SHA-1 hash is truncated to 128 bits to make the length work out. An erratum addresses the example in appendix B of RFC 4122.
| |
| | |
| == Implementations ==
| |
| ; ActionScript : [http://casalib.org/ CASA Lib] provides a Version 4 UUID function as part of the [http://as3.casalib.org/docs/org_casalib_util_StringUtil.html#uuid StringUtil] class.<ref>{{cite web | url = http://as3.casalib.org/docs/org_casalib_util_StringUtil.html#uuid | author = Aaron Clinger and the CASA Lib Team | title = CASA Lib's StringUtil Documentation}}</ref> [http://www.adobe.com/products/flex/ Adobe Flex] also provides a UUID implementation with the [http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/mx/utils/UIDUtil.html UIDUtil] class.<ref>{{cite web | url = http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/mx/utils/UIDUtil.html | author = Adobe Systems Incorporated | title = mx.utils.UIDUtil}}</ref>
| |
| ; Apache Solr : [[Solr]] contains an uuid data type.
| |
| ; C : On Linux, libuuid is part of the [[util-linux]] package since version 2.15.1 (previously in the [[e2fsprogs]] package, but this implementation is being phased out as not even e2fsprogs uses its internal implementation any more when possible <ref>[http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/commit/debian?id=95f65c3d70a7a883c3c98d7f53feed970dc64271 change that prevents the internal implementation from being used when an external implementation is available]</ref>). The OSSP project provides a UUID library.<ref>{{cite web | url = http://www.ossp.org/pkg/lib/uuid/ | title = Universally Unique Identifier (UUID) | author = Open Source Software Project}}</ref>
| |
| ; C++ : [http://sourceforge.net/projects/ooid/ Object Oriented ID] provides a C++ concrete type, i.e. designed to behave much like a built-in type. [http://qt-project.org/doc/qt-5.0/qtcore/quuid.html QUuid] is part of the C++ Qt framework. [http://www.boost.org/libs/uuid/ Boost.Uuid] is a header-only implementation under a non-reciprocal Open Source license.
| |
| ; Caché ObjectScript : UUID Version 4 [http://blog.yonatan.me/2010/07/uuid-version-4-for-cache-objectscript.html implementation] for [[Caché ObjectScript]].
| |
| ; CakePHP : [[Cakephp]] will automatically generate UUIDs for new records if the table's primary key data type is set to CHAR(36).<ref>{{cite web | url = http://book.cakephp.org/view/70/Using-UUIDs-as-Primary-Keys | title = Cake version 1.2 manual}}</ref>
| |
| ; Cassandra : [[Apache Cassandra|Cassandra]] uses version 1 UUIDs for a data type called 'timeuuid' for use in applications requiring conflict-free timestamps. A standard 'uuid' data type is also provided.<ref>{{cite web | url = http://www.datastax.com/documentation/cql/3.0/webhelp/index.html#cql/cql_reference/cql_data_types_c.html | title = Cassandra version 1.2 documentation}}</ref>
| |
| ; Cocoa/Carbon (Mac OS X/iOS) : The [[Core Foundation]] class CFUUIDRef is used to produce and store UUIDs, as well as to convert them to and from CFString/NSString representations. Since Mac OS X 10.8 and iOS 6.0, the NSUUID class is available.<ref>{{cite web | url = http://developer.apple.com/documentation/CoreFoundation/Reference/CFUUIDRef/Reference/reference.html | author = Apple Computer, Inc. | title = CFUUID Reference}}</ref>
| |
| ; CFML : The createUUID() function provides a UUID in all versions, however the format generated is in four segments instead of five xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx (8-4-4-16).<ref>{{cite web | url = http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-70de.html | author = Adobe Systems Inc. | title = ColdFusion Functions:CreateUUID}}</ref>
| |
| ; CodeGear RAD Studio (Delphi/C++ Builder) : A new GUID can be generated by pressing Ctrl+Shift+G. For runtime functions see the "Free Pascal & Lazarus IDE" section.
| |
| | |
| ; Common Lisp : Two libraries are available to create UUIDs according to RFC 4122. [https://github.com/dardoria/uuid uuid] creates v1, v3, v4 and v5 UUIDs. [http://github.com/mon-key/unicly Unicly] creates v3, v4, and v5 UUIDs.
| |
| ; CouchDB : If not provided, CouchDB sets the document ID for each document to be a UUID <ref>{{cite web | url = http://guide.couchdb.org/editions/1/en/api.html | title = Couch DB Core API Documentation}}</ref>
| |
| ; D : The Tango standard library includes a module to create UUIDs (v3, v4, and v5) according to RFC 4122.<ref>{{cite web | url = http://dsource.org/projects/tango/docs/current/tango.util.uuid.Uuid.html | title = D/Tango UUID API document}}</ref>
| |
| ; Eiffel : A library is available to create UUIDs Generates uuids according to RFC 4122, Variant 1 0, Version 4. Source available at [https://svn.eiffel.com/eiffelstudio/trunk/Src/library/uuid/ Eiffel UUID library]
| |
| ; Erlang : erlang-uuid<ref>{{cite web | url = http://gitorious.org/avtobiff/erlang-uuid | title = erlang-uuid | author = Per Andersson}}</ref> and uuid<ref>{{cite web | url = https://github.com/okeuday/uuid | title = uuid | author = Michael Truog}}</ref> implement UUID generation for versions 1, 3, 4, and 5 from RFC 4122. The v1 UUIDs generated are Erlang pid specific.
| |
| ; Firebird Server : [[Firebird (database server)|Firebird]] has gen_uuid() from version 2.1<ref>{{cite web | url = http://www.firebirdsql.org/rlsnotesh/rlsnotes210.html | title = Firebird 2.1 Release Notes}}</ref> and uuid_to_char() and char_to_uuid() from version 2.5<ref>{{cite web | url = http://www.firebirdsql.org/rlsnotesh/rlsnotes25.html | title = Firebird 2.5 Release Notes}}</ref> as built-in functions.
| |
| ; Free Pascal & Lazarus IDE : In [[Free Pascal]] there is a class called TGUID that holds the structure of a UUID. Also in the SysUtils.pas unit there are methods to create, compare and convert UUID's. They are CreateGUID(), GUIDToString() and IsEqualGUID().<ref>{{cite web | url = http://www.freepascal.org/docs-html/rtl/sysutils/index-5.html | title = Reference for 'sysutils' unit | author = Free Pascal Documentation}}</ref> In the [[Lazarus (software)|Lazarus IDE]] you can also generate a UUID by pressing Ctrl+Shift+G.
| |
| ; Go : The gouuid<ref>{{cite web | url = https://github.com/nu7hatch/gouuid | title = gouuid | author = Krzysztof Kowalik}}</ref> package provides, in pure Go, immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
| |
| ; Haskell : The package uuid<ref>{{cite web | url = http://hackage.haskell.org/package/uuid | title = uuid | author = Antoine Latter}}</ref> directly implements most of RFC 4122. The package supports generation (v1, v3, v4 and v5) as well as serialization to and from string and binary formats. The package system-uuid<ref>{{cite web | url = http://hackage.haskell.org/package/system-uuid | title = system-uuid | author = Jason Dusek}}</ref> provides bindings to the native UUID generators on Windows, Linux, FreeBSD and Mac OS X. | |
| ; Haxe : [https://github.com/rjanicek/janicek-core-haxe/blob/master/src/co/janicek/core/math/UUID.hx Haxe functions] which generate version 4 UUIDs as defined in the [http://www.ietf.org/rfc/rfc4122.txt RFC 4122 specification].
| |
| ; iOS : [https://developer.apple.com/library/mac/documentation/corefoundation/Reference/CFUUIDRef/Reference/reference.html CFUUID] and [https://developer.apple.com/library/Mac/DOCUMENTATION/Foundation/Reference/NSUUID_Class/Reference/Reference.html NSUUID] can both be used to create UUIDs in Objective-C.
| |
| ; Java : The [[Java Platform, Standard Edition|J2SE]] 5.0 release of [[Java (programming language)|Java]] provides a class that will produce 128-bit UUIDs, although it only implements version 3 (via the <code>nameUUIDFromBytes(byte[] name)</code> method) and 4 (via <code>UUID.randomUUID()</code>) generation methods, not the original version 1 (due to lack of means to access MAC addresses using pure Java before version 6). The API documentation for the {{Javadoc:SE|package=java.util|java/util|UUID}} class refers to ISO/IEC 11578:1996. Alternative open source libraries supporting MAC addresses on several common operating systems include [http://johannburkard.de/software/uuid/ UUID – generate UUIDs (or GUIDs) in Java] and [https://github.com/cowtowncoder/java-uuid-generator Java Uuid Generator (JUG)].
| |
| ; JavaScript : Broofa.com has implemented a [http://www.broofa.com/blog/2008/09/javascript-uuid-function/ JavaScript function] which generates version 4 UUIDs as defined in the [http://www.ietf.org/rfc/rfc4122.txt RFC 4122 specification]. An open source library [http://github.com/LiosK/UUID.js UUID.js], which is available under the MIT license, generates version 4 and version 1 UUIDs according to RFC 4122. Another open source library, [https://github.com/broofa/node-uuid node-uuid], also generates version 4 and version 1 UUIDS, and is available through the npm and ComponentJS package managers.
| |
| ; KohanaPHP : The [http://kohanaframework.org/ Kohana PHP Framework], supports the generation of version 3, 4, and 5 UUIDs according to RFC 4122 specifications using the UUID module.<ref>{{cite web | url =http://github.com/shadowhand/uuid | title = Kohana UUID module | first = Woody | last = Gilk }}</ref>
| |
| ; Lasso : A [http://tagswap.net/B_UUID custom tag for Lasso 8+] by Douglas Burchard, an [http://www.execuchoice.net/downloads.lasso LJAPI-module] by Steffan A. Cline, also for Lasso 8+. Lasso 9's implementation of [http://www.lassosoft.com/lassoDocs/languageReference/obj/lasso_uniqueid Lasso_UniqueID] also returns a UUID.
| |
| ; Lua : There is a [http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#luuid Lua module] by Luiz Henrique de Figueiredo.
| |
| ; Mac OS X : Command line utility '''uuidgen''' is available.
| |
| ; Microsoft SQL Server : Transact-SQL ([http://msdn2.microsoft.com/en-us/library/aa276822(SQL.80).aspx 2000] and [http://msdn2.microsoft.com/en-us/library/ms187942.aspx 2005]) provides a function called NEWID() to generate unique identifiers. [[Microsoft SQL Server 2005|SQL Server 2005]] provides an additional function called [http://msdn.microsoft.com/en-us/library/ms189786.aspx NEWSEQUENTIALID()] which generates a new [[Globally Unique Identifier|GUID]] that is greater than any [[Globally Unique Identifier|GUID]] previously created by the [http://msdn.microsoft.com/en-us/library/ms189786.aspx NEWSEQUENTIALID()] function on a given computer.
| |
| ; MySQL : [[MySQL]] provides a UUID() function.<ref>{{cite web | url = http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid | title = MySQL 5.0 Reference Manual | author = MySQL AB}}</ref>
| |
| ; .NET Framework : The [[.NET Framework]] also provides a structure <code>System.Guid</code> to generate and manipulate 128-bit UUIDs.<ref>{{cite web | url = http://msdn2.microsoft.com/en-us/library/system.guid.aspx | title = Guid Structure | work = [[MSDN Library]]}}</ref>
| |
| ; OCaml : The [http://erratique.ch/software/uuidm uuidm library] implements universally unique identifiers version 3, 5 (name based with MD5, SHA-1 hashing) and 4 (random based) according to RFC 4122.
| |
| ; Oracle Database : The [[Oracle Database]] provides a function <code>SYS_GUID()</code> to generate unique identifiers.<ref>{{cite web | url = http://docs.oracle.com/docs/cd/B12037_01/server.101/b10759/functions153.htm | title = SYS_GUID | work = Oracle Database SQL Reference | publisher = [[Oracle Corporation]]}}</ref>
| |
| ; Perl: The <code>Data::UUID</code> and <code>Data::GUID</code> modules from [[CPAN]] can be used to create UUIDs.<ref>{{cite web | url = https://metacpan.org/module/Data::GUID | title = Data-GUID | first = Ricardo | last = Signes | date = 16 January 2009 | work = [[CPAN]]}}</ref> The <code>UUID::Tiny</code> module is a lightweight, low dependency Pure Perl module for UUID creation and testing.<ref>{{cite web | url = https://metacpan.org/module/UUID::Tiny | title = UUID-Tiny | first = Christian | last = Augustin | date = 31 January 2010 | work = [[CPAN]]}}</ref>
| |
| ; PHP : In [[PHP]] there are several modules for creating UUIDs.<ref>{{cite web | url = http://pecl.php.net/package/uuid | title = uuid | work = [[PHP Extension Community Library|PECL]] | first = Hartmut | last = Holzgraefe | date = 1 April 2008}}</ref>
| |
| ; PostgreSQL : [[PostgreSQL]] contains an uuid data type. Also various generation functions as part of the uuid-ossp contrib module.<ref>{{cite web | url = http://www.postgresql.org/docs/8.3/static/datatype-uuid.html | title = PostgreSQL 8.3.x Documentation: UUID Type | author = PostgreSQL Global Development Group}}</ref>
| |
| ; Progress OpenEdge ABL : The <code>GENERATE-UUID</code> function in OpenEdge 10 provides a UUID which can be made printable using the <code>GUID()</code> or <code>BASE64-ENCODE()</code> functions.<ref>http://www.psdn.com/library/servlet/KbServlet/download/1927-102-2537/dvref.pdf{{Dead link|date=June 2013}}</ref>
| |
| ; Python : The uuid module<ref>{{cite web | url = http://docs.python.org/lib/module-uuid.html | title = Python Library Reference: uuid}}</ref> (included in the standard library since [[Python (programming language)|Python]] 2.5) creates UUIDs according to RFC 4122.
| |
| ; Revolution/RunRev : The libUUID library<ref>{{cite web | url = http://futsoft.futilism.com/revolutionstuff.html | title = Revolution Stuff: libUUID}}</ref> A library that generates UUIDs of type 1 (time based), type 3 (name-based) and type 4 (random-based). Version 1.0. by Mark Smith. OSL 3.0
| |
| ; Ruby : There are several RFC4122 implementations for [[Ruby (programming language)|Ruby]], the most updated ones being [http://raa.ruby-lang.org/project/ruby-uuid/ Ruby-UUID] (<!-- not online anymore; -->fork here [http://github.com/spectra/ruby-uuid]), [https://rubygems.org/gems/uuid UUID] and [http://rubyforge.org/projects/uuidtools/ UUIDTools]. Ruby 1.9 includes a built-in version 4 uuid generator (<code>SecureRandom.uuid</code>).
| |
| ; SAP BusinessObjects Data Services : The ETL tool SAP BusinessObjects Data Services contains a function to generate a UUID: <code>gen_uuid()</code>.<ref>{{cite web | url = http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_ds_whats_new_en.pdf | title =SAP BusinessObjects Data Services XI 4.0 features }}</ref>
| |
| ; Tcl : A [[Tcl]] implementation is provided in the TclLib package.<ref>{{cite web | url = http://tcllib.sourceforge.net/doc/uuid.html | title = Tcl Standard Library: uuid}}</ref>
| |
| ; Unix : Command line utility '''uuidgen''' may be provided by default. There is also a tool called simply "uuid" available, which has the same functionality. The FreeBSD and Linux kernels have a built-in UUID v4 generator too. To use this on Linux, you have to read the file /proc/sys/kernel/random/uuid. On FreeBSD there is a simple system call uuidgen(2).
| |
| ;
| |
| | |
| ==Random UUID probability of duplicates==
| |
| Randomly generated UUIDs have 122 random bits. Out of a total of 128 bits, four bits are used for the version ('Randomly generated UUID'), and two bits for the variant ('Leach-Salz'). With random UUIDs, the chance of two having the same value can be calculated using probability theory ([[Birthday paradox]]). Using the approximation
| |
| :<math>p(n)\approx 1-e^{-\tfrac{n^2}{{2x}}}</math>
| |
| these are the probabilities of an accidental clash after calculating ''n'' UUIDs, with ''x''=2<sup>122</sup>:
| |
| <table class="wikitable">
| |
| <tr><th align=right>n</th><th>probability</th></tr>
| |
| <tr><td align=right>68,719,476,736 = 2<sup>36</sup></td><td>0.0000000000000004 (4 × 10<sup>−16</sup>)</td></tr>
| |
| <tr><td align=right>2,199,023,255,552 = 2<sup>41</sup></td><td>0.0000000000004 (4 × 10<sup>−13</sup>)</td></tr>
| |
| <tr><td align=right>70,368,744,177,664 = 2<sup>46</sup></td><td>0.0000000004 (4 × 10<sup>−10</sup>)</td></tr>
| |
| </table>
| |
| | |
| To put these numbers into perspective, the annual risk of someone being hit by a meteorite is estimated to be one chance in 17 billion,<ref>[http://www.dartmouth.edu/~chance/chance_news/recent_news/chance_news_2.21.html Old Farmer's Almanac 1994, 220–222, Taking your Chances: An Explanation of Risk]</ref> which means the probability is about 0.00000000006 (6 × 10<sup>−11</sup>), equivalent to the odds of creating a few tens of trillions of UUIDs in a year and having one duplicate. In other words, only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%. Or, to put it another way, the probability of one duplicate would be about 50% if every person on earth owns 600 million UUIDs.
| |
| | |
| However, these probabilities only hold when the UUIDs are generated using sufficient [[Entropy (information theory)|entropy]]. Otherwise, the probability of duplicates could be significantly higher, since the [[statistical dispersion]] might be lower.
| |
| | |
| ==History==
| |
| The initial design of DCE UUIDs was based on UUIDs as defined in the [[Network Computing System]],<ref>{{cite book
| |
| | last = Zahn
| |
| | first = Lisa
| |
| | title = Network Computing Architecture
| |
| | page = 10
| |
| | publisher = [[Prentice Hall]]
| |
| | year = 1990
| |
| | isbn = 0-13-611674-4 }}</ref> whose design was in turn inspired by the (64-bit) unique identifiers defined and used pervasively in [[Domain/OS]], the [[operating system]] designed by [[Apollo Computer]], Inc.
| |
| | |
| ==See also==
| |
| *[[Globally unique identifier]]
| |
| | |
| ==References==
| |
| {{Reflist|2}}
| |
| | |
| ==External links==
| |
| * [http://www.itu.int/rec/T-REC-X.667/en International Standard "X.667 : … Generation … of Universally Unique Identifiers (UUIDs)…"] (ITU-T Rec. X.667 as of 2008–08, freely available)
| |
| * [http://www.itu.int/ITU-T/studygroups/com17/oid.html International Standard "Generation and registration of Universally Unique Identifiers (UUIDs) and their use as ASN.1 Object Identifier components"] (ITU-T Rec. X.667, freely available)
| |
| * [http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=53416 ISO/IEC 9834-8:2008 "... Generation and registration of Universally Unique Identifiers (UUIDs) and their use as ASN.1 Object Identifier components"]
| |
| * [http://www.ietf.org/rfc/rfc4122.txt A Universally Unique IDentifier (UUID) URN Namespace] (IETF RFC 4122)
| |
| * [http://www.famkruithof.net/uuid/uuidgen?typeReq=-1 Extract the time from a version 1 UUID / GUID]
| |
| *[http://www.itu.int/ITU-T/asn1/uuid.html Global UUID registration function at ITU-T]
| |
| *[http://jakarta.apache.org/commons/sandbox/id/uuid.html Commons Id]
| |
| *[http://www.infonuovo.com/dma/csdocs/sketch/instidid.htm DmaId for InstanceId Values (DCE Universally Unique IDentifiers, UUIDs)]
| |
| *[http://www.opengroup.org/onlinepubs/9629399/apdxa.htm Syntax and semantics of the DCE variant of Universal Unique Identifiers (UUIDs)]
| |
| *[http://www.h2database.com/html/advanced.html#uuid Random UUID Probability of Duplicates]
| |
| *[http://www.itu.int/ITU-T/asn1/uuid.html ITU registration of UUIDs and representation of a UUID as an OID]
| |
| | |
| {{Use dmy dates|date=May 2013}}
| |
| | |
| {{DEFAULTSORT:Universally Unique Identifier}}
| |
| [[Category:Identifiers]]
| |
| [[Category:Universal identifiers]]
| |