.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "UUID 3pm" .TH UUID 3pm "2018-11-02" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::UUID \- Globally/Universally Unique Identifiers (GUIDs/UUIDs) .SH "SEE INSTEAD?" .IX Header "SEE INSTEAD?" The module Data::GUID provides another interface for generating GUIDs. Right now, it relies on Data::UUID, but it may not in the future. Its interface may be just a little more straightforward for the average Perl programer. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Data::UUID; \& \& $ug = Data::UUID\->new; \& $uuid1 = $ug\->create(); \& $uuid2 = $ug\->create_from_name(, ); \& \& $res = $ug\->compare($uuid1, $uuid2); \& \& $str = $ug\->to_string( $uuid ); \& $uuid = $ug\->from_string( $str ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a framework for generating v3 UUIDs (Universally Unique Identifiers, also known as GUIDs (Globally Unique Identifiers). A \s-1UUID\s0 is 128 bits long, and is guaranteed to be different from all other UUIDs/GUIDs generated until 3400 \s-1CE.\s0 .PP UUIDs were originally used in the Network Computing System (\s-1NCS\s0) and later in the Open Software Foundation's (\s-1OSF\s0) Distributed Computing Environment. Currently many different technologies rely on UUIDs to provide unique identity for various software components. Microsoft \s-1COM/DCOM\s0 for instance, uses GUIDs very extensively to uniquely identify classes, applications and components across network-connected systems. .PP The algorithm for \s-1UUID\s0 generation, used by this extension, is described in the Internet Draft \*(L"UUIDs and GUIDs\*(R" by Paul J. Leach and Rich Salz. (See \s-1RFC 4122.\s0) It provides reasonably efficient and reliable framework for generating UUIDs and supports fairly high allocation rates \*(-- 10 million per second per machine \*(-- and therefore is suitable for identifying both extremely short-lived and very persistent objects on a given system as well as across the network. .PP This modules provides several methods to create a \s-1UUID.\s0 In all methods, \f(CW\*(C`\*(C'\fR is a \s-1UUID\s0 and \f(CW\*(C`\*(C'\fR is a free form string. .PP .Vb 3 \& # creates binary (16 byte long binary value) UUID. \& $ug\->create(); \& $ug\->create_bin(); \& \& # creates binary (16\-byte long binary value) UUID based on particular \& # namespace and name string. \& $ug\->create_from_name(, ); \& $ug\->create_from_name_bin(, ); \& \& # creates UUID string, using conventional UUID string format, \& # such as: 4162F712\-1DD2\-11B2\-B17E\-C09EFE1DC403 \& $ug\->create_str(); \& $ug\->create_from_name_str(, ); \& \& # creates UUID string as a hex string, \& # such as: 0x4162F7121DD211B2B17EC09EFE1DC403 \& $ug\->create_hex(); \& $ug\->create_from_name_hex(, ); \& \& # creates UUID string as a Base64\-encoded string \& $ug\->create_b64(); \& $ug\->create_from_name_b64(, ); \& \& Binary UUIDs can be converted to printable strings using following methods: \& \& # convert to conventional string representation \& $ug\->to_string(); \& \& # convert to hex string \& $ug\->to_hexstring(); \& \& # convert to Base64\-encoded string \& $ug\->to_b64string(); \& \& Conversly, string UUIDs can be converted back to binary form: \& \& # recreate binary UUID from string \& $ug\->from_string(); \& $ug\->from_hexstring(); \& \& # recreate binary UUID from Base64\-encoded string \& $ug\->from_b64string(); \& \& Finally, two binary UUIDs can be compared using the following method: \& \& # returns \-1, 0 or 1 depending on whether uuid1 less \& # than, equals to, or greater than uuid2 \& $ug\->compare(, ); .Ve .PP Examples: .PP .Vb 1 \& use Data::UUID; \& \& # this creates a new UUID in string form, based on the standard namespace \& # UUID NameSpace_URL and name "www.mycompany.com" \& \& $ug = Data::UUID\->new; \& print $ug\->create_from_name_str(NameSpace_URL, "www.mycompany.com"); .Ve .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" The module allows exporting of several standard namespace UUIDs: .IP "NameSpace_DNS" 4 .IX Item "NameSpace_DNS" .PD 0 .IP "NameSpace_URL" 4 .IX Item "NameSpace_URL" .IP "NameSpace_OID" 4 .IX Item "NameSpace_OID" .IP "NameSpace_X500" 4 .IX Item "NameSpace_X500" .PD .SH "AUTHOR" .IX Header "AUTHOR" Alexander Golomshtok .SH "SEE ALSO" .IX Header "SEE ALSO" The Internet Draft \*(L"UUIDs and GUIDs\*(R" by Paul J. Leach and Rich Salz (\s-1RFC 4122\s0)