Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

data::uuid::libuuid(3pm) [debian man page]

Data::UUID::LibUUID(3pm)				User Contributed Perl Documentation				  Data::UUID::LibUUID(3pm)

NAME
Data::UUID::LibUUID - uuid.h based UUID generation (versions 2 and 4 depending on platform) SYNOPSIS
use Data::UUID::LibUUID; my $uuid = new_uuid_string(); DESCRIPTION
This module provides bindings for libuuid shipped with e2fsprogs or uuid-dev on debian, and also works with the system uuid.h on darwin. EXPORTS
new_uuid_string $version new_uuid_binary $version Returns a new UUID in string (dash separated hex) or binary (16 octets) format. $version can be either 2, or 4 and defaults to whatever the underlying implementation prefers. 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. Version 2 is described here <http://www.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01>. It is similar to version 1 but considered more secure. Version 4 is based just on random data. This is not guaranteed to be high quality random data, but usually is supposed to be. On MacOS X "getpid" is called before UUID generation, to ensure UUIDs are unique accross forks. Behavior on other platforms may vary. uuid_to_binary $str_or_bin Converts a UUID from string or binary format to binary format. Returns undef on a non UUID argument. uuid_to_string $str_or_bin Converts a UUID from string or binary format to string format. Returns undef on a non UUID argument. 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. Returns undef on non UUID arguments. uuid_compare $str_or_bin, $str_or_bin Returns -1, 0 or 1 depending on the lexicographical order of the UUID. This works like the "cmp" builtin. Returns undef on non UUID arguments. new_dce_uuid_string new_dce_uuid_binary 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: package MyFoo; use Data::UUID::LibUUID ( new_dce_uuid_string => { -as "generate_uuid" }, ); sub yadda { my $self = shift; my $id = $self->generate_uuid; } This allows the ID generation code to be subclassed, but still keeps the hassle down to a minimum. DCE is UUID version two specification. ascending_ident Creates a lexically ascending identifier containing a UUID, high resolution timestamp, and a counter. This is not a UUID (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. 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. TODO
o Consider bundling libuuid for when no system "uuid.h" exists. SEE ALSO
Data::GUID, Data::UUID, UUID, <http://e2fsprogs.sourceforge.net/> VERSION CONTROL
This module is maintained using Darcs. You can get the latest version from <http://nothingmuch.woobling.org/code>, and use "darcs send" to commit changes. AUTHOR
Yuval Kogman <nothingmuch@woobling.org> COPYRIGHT
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. perl v5.14.2 2010-07-05 Data::UUID::LibUUID(3pm)

Check Out this Related Man Page

UUID_GENERATE(3)					     Library Functions Manual						  UUID_GENERATE(3)

NAME
uuid_generate, uuid_generate_random, uuid_generate_time - create a new unique UUID value SYNOPSIS
#include <uuid/uuid.h> void uuid_generate(uuid_t out); void uuid_generate_random(uuid_t out); void uuid_generate_time(uuid_t out); DESCRIPTION
The uuid_generate function creates a new universally unique identifier (UUID). The uuid will be generated based on high-quality randomness from /dev/urandom, if available. If it is not available, then uuid_generate will use an alternative algorithm which uses the current time, the local ethernet MAC address (if available), and random data generated using a pseudo-random generator. The uuid_generate_random function forces the use of the all-random UUID format, even if a high-quality random number generator (i.e., /dev/urandom) is not available, in which case a pseudo-random generator will be subsituted. Note that the use of a pseudo-random generator may compromise the uniqueness of UUID's generated in this fashion. The uuid_generate_time function forces the use of the alternative algorithm which uses the current time and the local ethernet MAC address (if available). This algorithm used to be the default one used to generate UUID, but because of the use of the ethernet MAC address, it can leak information about when and where the UUID was generated. This can cause privacy problems in some applications, so the uuid_gener- ate function only uses this algorithm if a high-quality source of randomness is not available. The UUID is 16 bytes (128 bits) long, which gives approximately 3.4x10^38 unique values (there are approximately 10^80 elemntary particles in the universe according to Carl Sagan's Cosmos). The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future. RETURN VALUE
The newly created UUID is returned in the memory location pointed to by out. CONFORMING TO
OSF DCE 1.1 AUTHOR
Theodore Y. Ts'o AVAILABILITY
http://e2fsprogs.sourceforge.net/ <http://e2fsprogs.sourceforge.net/> SEE ALSO
uuid(3), uuidgen(1), uuid_clear(3), uuid_compare(3), uuid_copy(3), uuid_is_null(3), uuid_parse(3), uuid_unparse(3) 1.36 April 2004 UUID_GENERATE(3)
Man Page