1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca)
.\"
.\" This file may be copied under the terms of the GNU Public License.
.TH UUIDGEN 1 "June 2011" "util-linux" "User Commands"
.SH NAME
uuidgen \- create a new UUID value
.SH SYNOPSIS
.B uuidgen
[options]
.SH DESCRIPTION
The
.B uuidgen
program creates (and prints)
a new universally unique identifier (UUID) using the
.BR libuuid (3)
library. 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.
.PP
There are three types of UUIDs which
.B uuidgen
can generate: time-based UUIDs, random-based UUIDs, and hash-based UUIDs.
By default
.B uuidgen
will generate a random-based UUID if a high-quality random number
generator is present. Otherwise, it will choose a time-based UUID.
It is possible to force the generation of one of these first two
UUID types by using the
.B \-\-random
or
.B \-\-time
options.
.PP
The third type of UUID is generated with the
.B \-\-md5
or
.B \-\-sha1
options, followed by
\fB\-\-namespace\fR \fInamespace\fR
and
\fB\-\-name\fR \fIname\fR.
The \fInamespace\fR may either be a well-known UUID, or else
an alias to one of the well-known UUIDs defined in RFC 4122, that is
.BR @dns ,
.BR @url ,
.BR @oid ,
or
.BR @x500 .
The \fIname\fR is an arbitrary string value. The generated UUID is the
digest of the concatenation of the namespace UUID and the name value, hashed
with the MD5 or SHA1 algorithms. It is, therefore, a predictable value
which may be useful when UUIDs are being used as handles or nonces for
more complex values or values which shouldn't be disclosed directly.
See the RFC for more information.
.SH OPTIONS
.TP
.BR \-r , " \-\-random"
Generate a random-based UUID. This method creates a UUID consisting mostly
of random bits. It requires that the operating system have a high
quality random number generator, such as
.IR /dev/random .
.TP
.BR \-t , " \-\-time"
Generate a time-based UUID. This method creates a UUID based on the system
clock plus the system's ethernet hardware address, if present.
.TP
.BR \-h , " \-\-help"
Display help text and exit.
.TP
.BR \-V , " \-\-version"
Display version information and exit.
.TP
.BR \-m , " \-\-md5"
Use MD5 as the hash algorithm.
.TP
.BR \-s , " \-\-sha1"
Use SHA1 as the hash algorithm.
.TP
.BR \-n , " \-\-namespace " \fInamespace\fP
Generate the hash with the \fInamespace\fP prefix. The \fInamespace\fP is UUID,
or '@ns' where "ns" is well-known predefined UUID addressed by namespace name
(see above).
.TP
.BR \-N , " \-\-name " \fIname\fR
Generate the hash of the \fIname\fR.
.TP
.BR \-x , " \-\-hex"
Interpret name \fIname\fR as a hexadecimal string.
.SH "CONFORMING TO"
OSF DCE 1.1
.SH EXAMPLES
uuidgen \-\-sha1 \-\-namespace @dns \-\-name "www.example.com"
.SH AUTHOR
.B uuidgen
was written by Andreas Dilger for libuuid.
.SH SEE ALSO
.BR libuuid (3),
.B "RFC 4122"
.SH AVAILABILITY
The uuidgen command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.
|