.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 "Data::UUID::LibUUID 3pm" .TH Data::UUID::LibUUID 3pm "2020-11-09" "perl v5.32.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::LibUUID \- uuid.h based UUID generation (versions 2 and 4 depending on platform) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Data::UUID::LibUUID; \& \& my $uuid = new_uuid_string(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides bindings for libuuid shipped with e2fsprogs or uuid-dev on debian, and also works with the system \fIuuid.h\fR on darwin. .SH "EXPORTS" .IX Header "EXPORTS" .ie n .IP "new_uuid_string $version" 4 .el .IP "new_uuid_string \f(CW$version\fR" 4 .IX Item "new_uuid_string $version" .PD 0 .ie n .IP "new_uuid_binary $version" 4 .el .IP "new_uuid_binary \f(CW$version\fR" 4 .IX Item "new_uuid_binary $version" .PD Returns a new \s-1UUID\s0 in string (dash separated hex) or binary (16 octets) format. .Sp \&\f(CW$version\fR can be either 2, or 4 and defaults to whatever the underlying implementation prefers. .Sp Version 1 is timestamp/MAC based UUIDs, like Data::UUID provides. They reveal time and host information, so they may be considered a security risk. .Sp Version 2 is described here . It is similar to version 1 but considered more secure. .Sp Version 4 is based just on random data. This is not guaranteed to be high quality random data, but usually is supposed to be. .Sp On MacOS X \f(CW\*(C`getpid\*(C'\fR is called before \s-1UUID\s0 generation, to ensure UUIDs are unique accross forks. Behavior on other platforms may vary. .ie n .IP "uuid_to_binary $str_or_bin" 4 .el .IP "uuid_to_binary \f(CW$str_or_bin\fR" 4 .IX Item "uuid_to_binary $str_or_bin" Converts a \s-1UUID\s0 from string or binary format to binary format. .Sp Returns undef on a non \s-1UUID\s0 argument. .ie n .IP "uuid_to_string $str_or_bin" 4 .el .IP "uuid_to_string \f(CW$str_or_bin\fR" 4 .IX Item "uuid_to_string $str_or_bin" Converts a \s-1UUID\s0 from string or binary format to string format. .Sp Returns undef on a non \s-1UUID\s0 argument. .ie n .IP "uuid_eq $str_or_bin, $str_or_bin" 4 .el .IP "uuid_eq \f(CW$str_or_bin\fR, \f(CW$str_or_bin\fR" 4 .IX Item "uuid_eq $str_or_bin, $str_or_bin" Checks if two UUIDs are equivalent. Returns true if they are, or false if they aren't. .Sp Returns undef on non \s-1UUID\s0 arguments. .ie n .IP "uuid_compare $str_or_bin, $str_or_bin" 4 .el .IP "uuid_compare \f(CW$str_or_bin\fR, \f(CW$str_or_bin\fR" 4 .IX Item "uuid_compare $str_or_bin, $str_or_bin" Returns \-1, 0 or 1 depending on the lexicographical order of the \s-1UUID.\s0 This works like the \f(CW\*(C`cmp\*(C'\fR builtin. .Sp Returns undef on non \s-1UUID\s0 arguments. .IP "new_dce_uuid_string" 4 .IX Item "new_dce_uuid_string" .PD 0 .IP "new_dce_uuid_binary" 4 .IX Item "new_dce_uuid_binary" .PD These two subroutines are a little hackish in that they take no arguments but also do not validate the arguments, so they can be abused as methods: .Sp .Vb 1 \& package MyFoo; \& \& use Data::UUID::LibUUID ( \& new_dce_uuid_string => { \-as "generate_uuid" }, \& ); \& \& sub yadda { \& my $self = shift; \& my $id = $self\->generate_uuid; \& } .Ve .Sp This allows the \s-1ID\s0 generation code to be subclassed, but still keeps the hassle down to a minimum. \s-1DCE\s0 is \s-1UUID\s0 version two specification. .IP "ascending_ident" 4 .IX Item "ascending_ident" Creates a lexically ascending identifier containing a \s-1UUID,\s0 high resolution timestamp, and a counter. .Sp This is not a \s-1UUID\s0 (it's longer), but if you can store variable length identifier (and exposing the system clock is not an issue) they can be used to create an identifier that is both universally unique, and lexically increasing. .Sp Note that while the identifiers are universally unique, there is no universal ordering (that would require synchronization), so identifiers generated on different machines or even different process/thread could have IDs which interleave. .SH "TODO" .IX Header "TODO" .IP "\(bu" 4 Consider bundling libuuid for when no system \f(CW\*(C`uuid.h\*(C'\fR exists. .SH "SEE ALSO" .IX Header "SEE ALSO" Data::GUID, Data::UUID, \s-1UUID\s0, .SH "VERSION CONTROL" .IX Header "VERSION CONTROL" This module is maintained using Darcs. You can get the latest version from , and use \f(CW\*(C`darcs send\*(C'\fR to commit changes. .SH "AUTHOR" .IX Header "AUTHOR" Yuval Kogman .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 3 \& Copyright (c) 2008 Yuval Kogman. All rights reserved \& This program is free software; you can redistribute \& it and/or modify it under the same terms as Perl itself. .Ve