blob: 998e042980b560d7d8b060462fa08b265cad6404 [file] [log] [blame]
Theodore Ts'o4eca93b1999-03-16 20:31:56 +00001.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca)
2.\"
Theodore Ts'o9dd97ae2004-04-03 11:24:10 -05003.\" %Begin-Header%
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, and the entire permission notice in its entirety,
9.\" including the disclaimer of warranties.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\" 3. The name of the author may not be used to endorse or promote
14.\" products derived from this software without specific prior
15.\" written permission.
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000016.\"
Theodore Ts'o9dd97ae2004-04-03 11:24:10 -050017.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
20.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
21.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
23.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
28.\" DAMAGE.
29.\" %End-Header%
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000030.\"
31.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger
32.TH UUID_GENERATE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
33.SH NAME
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000034uuid_generate, uuid_generate_random, uuid_generate_time \- create a new unique UUID value
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000035.SH SYNOPSIS
36.nf
37.B #include <uuid/uuid.h>
38.sp
39.BI "void uuid_generate(uuid_t " out );
Theodore Ts'ob19d1a91999-06-18 00:32:03 +000040.BI "void uuid_generate_random(uuid_t " out );
41.BI "void uuid_generate_time(uuid_t " out );
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000042.fi
43.SH DESCRIPTION
44The
45.B uuid_generate
Theodore Ts'ob19d1a91999-06-18 00:32:03 +000046function creates a new universally unique identifier (UUID). The uuid will
47be generated based on high-quality randomness from
48.IR /dev/urandom ,
49if available. If it is not available, then
50.B uuid_generate
51will use an alternative algorithm which uses the current time, the
52local ethernet MAC address (if available), and random data generated
53using a pseudo-random generator.
54.sp
55The
56.B uuid_generate_random
57function forces the use of the all-random UUID format, even if
58a high-quality random number generator (i.e.,
59.IR /dev/urandom )
60is not available, in which case a pseudo-random
61generator will be subsituted. Note that the use of a pseudo-random
62generator may compromise the uniqueness of UUID's
63generated in this fashion.
64.sp
65The
66.B uuid_generate_time
67function forces the use of the alternative algorithm which uses the
68current time and the local ethernet MAC address (if available).
69This algorithm used to be the default one used to generate UUID, but
70because of the use of the ethernet MAC address, it can leak
71information about when and where the UUID was generated. This can cause
72privacy problems in some applications, so the
73.B uuid_generate
74function only uses this algorithm if a high-quality source of
75randomness is not available.
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000076.sp
77The UUID is 16 bytes (128 bits) long, which gives approximately 3.4x10^38
78unique values (there are approximately 10^80 elemntary particles in
79the universe according to Carl Sagan's
80.IR Cosmos ).
81The new UUID can reasonably be considered unique among all UUIDs created
82on the local system, and among UUIDs created on other systems in the past
83and in the future.
84.SH RETURN VALUE
85The newly created UUID is returned in the memory location pointed to by
86.IR out .
87.SH "CONFORMING TO"
88OSF DCE 1.1
89.SH AUTHOR
Theodore Ts'o6d493492004-05-04 22:05:05 -040090Theodore Y. Ts'o
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000091.SH AVAILABILITY
Theodore Ts'o6d493492004-05-04 22:05:05 -040092.UR http://e2fsprogs.sourceforge.net/
93http://e2fsprogs.sourceforge.net/
94.UE
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000095.SH "SEE ALSO"
Theodore Ts'o6d493492004-05-04 22:05:05 -040096.BR uuid (3),
97.BR uuidgen (1),
Theodore Ts'o4eca93b1999-03-16 20:31:56 +000098.BR uuid_clear (3),
99.BR uuid_compare (3),
100.BR uuid_copy (3),
Theodore Ts'o4eca93b1999-03-16 20:31:56 +0000101.BR uuid_is_null (3),
102.BR uuid_parse (3),
103.BR uuid_time (3),
104.BR uuid_unparse (3)