7
7
<primary>uuid-ossp</primary>
8
8
</indexterm>
9
9
10
+ <!--
11
+ <para>
12
+ The <filename>uuid-ossp</> module provides functions to generate universally
13
+ unique identifiers (UUIDs) using one of several standard algorithms. There
14
+ are also functions to produce certain special UUID constants.
15
+ </para>
16
+ -->
10
17
<para>
11
18
<filename>uuid-ossp</>模块提供了一些函数用来生成通用唯一识别码(UUID),
12
19
它支持几种 UUID 产生的标准算法。同时它还提供了一些函数用来产生某些特定
13
20
的UUID常量。
14
21
</para>
15
22
23
+ <!--
24
+ <para>
25
+ This module depends on the OSSP UUID library, which can be found at
26
+ <ulink url="http://www.ossp.org/pkg/lib/uuid/"></ulink>.
27
+ </para>
28
+ -->
16
29
<para>
17
30
这个模块依赖于 OSSP UUID 库,
18
31
<ulink url="http://www.ossp.org/pkg/lib/uuid/"></ulink>.
19
32
</para>
20
33
21
34
<sect2>
22
- <title><literal>uuid-ossp</literal> 函数</title>
35
+ <!--
36
+ <title><literal>uuid-ossp</literal> Functions</title>
37
+ -->
38
+ <title><literal>uuid-ossp</literal> 函数</title>
23
39
40
+ <!--
24
41
<para>
42
+ <xref linkend="uuid-ossp-functions"> shows the functions available to
43
+ generate UUIDs.
44
+ The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and RFC
45
+ 4122 specify four algorithms for generating UUIDs, identified by the
46
+ version numbers 1, 3, 4, and 5. (There is no version 2 algorithm.)
47
+ Each of these algorithms could be suitable for a different set of
48
+ applications.
49
+ </para>
50
+ -->
51
+ <para>
25
52
<xref linkend="uuid-ossp-functions"> 中的函数用来产生 UUID。
26
53
相关标准 ITU-T Rec. X.667, ISO/IEC 9834-8:2005 和 RFC
27
54
4122 定义了四种生成 UUID 的算法, 分别在版本
28
55
1, 3, 4 和5中定义(没用版本2算法)每个算法适合于不同种类的应用使用。
29
56
</para>
30
57
31
58
<table id="uuid-ossp-functions">
32
- <title>UUID 生成函数</title>
59
+ <!--
60
+ <title>Functions for UUID Generation</title>
61
+ -->
62
+ <title>UUID 生成函数</title>
33
63
<tgroup cols="2">
34
64
<thead>
35
65
<row>
36
- <entry>函数</entry>
66
+ <!--
67
+ <entry>Function</entry>
68
+ <entry>Description</entry>
69
+ -->
70
+ <entry>函数</entry>
37
71
<entry>描述</entry>
38
72
</row>
39
73
</thead>
40
74
<tbody>
41
75
<row>
42
76
<entry><function>uuid_generate_v1()</function><indexterm><primary>uuid_generate_v1</primary></indexterm></entry>
43
77
<entry>
44
- <para>
78
+ <!--
79
+ <para>
80
+ This function generates a version 1 UUID. This involves the MAC
81
+ address of the computer and a time stamp. Note that UUIDs of this
82
+ kind reveal the identity of the computer that created the identifier
83
+ and the time at which it did so, which might make it unsuitable for
84
+ certain security-sensitive applications.
85
+ </para>
86
+ -->
87
+ <para>
45
88
这个函数生成版本1的 UUID。它的算法使用了计算机的MAC地址和时间戳。注意这种
46
89
UUID 泄露了生成它的计算机标识和生成它的时间,所以它可能不太适合对安全性要求较高的应用。
47
90
</para>
50
93
<row>
51
94
<entry><function>uuid_generate_v1mc()</function><indexterm><primary>uuid_generate_v1mc</primary></indexterm></entry>
52
95
<entry>
53
- <para>
96
+ <!--
97
+ <para>
98
+ This function generates a version 1 UUID but uses a random multicast
99
+ MAC address instead of the real MAC address of the computer.
100
+ </para>
101
+ -->
102
+ <para>
54
103
这个函数生成一个版本1的 UUID,但是使用一个随机多播 MAC
55
104
地址而不是计算机的真实的 MAC 地址。
56
105
</para>
59
108
<row>
60
109
<entry><function>uuid_generate_v3(namespace uuid, name text)</function><indexterm><primary>uuid_generate_v3</primary></indexterm></entry>
61
110
<entry>
62
- <para>
111
+ <!--
112
+ <para>
113
+ This function generates a version 3 UUID in the given namespace using
114
+ the specified input name. The namespace should be one of the special
115
+ constants produced by the <function>uuid_ns_*()</> functions shown
116
+ in <xref linkend="uuid-ossp-constants">. (It could be any UUID in theory.) The name is an identifier
117
+ in the selected namespace.
118
+ </para>
119
+ -->
120
+ <para>
63
121
这个函数使用给定的输入名字(name)在给定的命名空间(namespace)
64
122
中生成一个版本3的 UUID。给定的命名空间应该是调用表
65
123
<xref linkend="uuid-ossp-constants"> 中的函数
68
126
</para>
69
127
70
128
<para>
129
+ <!--
130
+ For example:
131
+ -->
71
132
例如:
72
133
73
134
<programlisting>
74
135
SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
75
136
</programlisting>
76
137
138
+ <!--
139
+ The name parameter will be MD5-hashed, so the cleartext cannot be
140
+ derived from the generated UUID.
141
+ The generation of UUIDs by this method has no random or
142
+ environment-dependent element and is therefore reproducible.
143
+ -->
77
144
参数 name会被使用 MD5 算法做哈希,所以从产生的 UUID 中不可能反向获得明文。
78
145
利用这个方法生成的 UUID 不需要随机算法不依赖任何运行相关的环境因素,因此生成过程是可重复的。
79
146
</para>
@@ -82,15 +149,29 @@ SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
82
149
<row>
83
150
<entry><literal>uuid_generate_v4()</literal></entry>
84
151
<entry>
152
+ <!--
85
153
<para>
154
+ This function generates a version 4 UUID, which is derived entirely
155
+ from random numbers.
156
+ </para>
157
+ -->
158
+ <para>
86
159
这个函数生成一个版本4的 UUID,它完全依靠随机数。
87
160
</para>
88
161
</entry>
89
162
</row>
90
163
<row>
91
164
<entry><literal>uuid_generate_v5(namespace uuid, name text)</literal></entry>
92
165
<entry>
166
+ <!--
93
167
<para>
168
+ This function generates a version 5 UUID, which works like a version 3
169
+ UUID except that SHA-1 is used as a hashing method. Version 5 should
170
+ be preferred over version 3 because SHA-1 is thought to be more secure
171
+ than MD5.
172
+ </para>
173
+ -->
174
+ <para>
94
175
这个函数生成一个版本5的 UUID,它个工作过程类似于版本3的
95
176
UUID,但是它使用的 SHA-1 的哈希算法。因为 SHA-1 算法被认为比 MD5
96
177
算法更安全,所有应该尽量使用版本 5 而不版本 3。
@@ -102,45 +183,76 @@ SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
102
183
</table>
103
184
104
185
<table id="uuid-ossp-constants">
186
+ <!--
187
+ <title>Functions Returning UUID Constants</title>
188
+ -->
105
189
<title>返回 UUID 常量的函数</title>
106
190
<tgroup cols="2">
107
191
<tbody>
108
192
<row>
109
193
<entry><literal>uuid_nil()</literal></entry>
110
194
<entry>
195
+ <!--
111
196
<para>
197
+ A <quote>nil</> UUID constant, which does not occur as a real UUID.
198
+ </para>
199
+ -->
200
+ <para>
112
201
一个 <quote>nil</> UUID 常量, 它不应该看作一个真正的 UUID。
113
202
</para>
114
203
</entry>
115
204
</row>
116
205
<row>
117
206
<entry><literal>uuid_ns_dns()</literal></entry>
118
207
<entry>
208
+ <!--
119
209
<para>
210
+ Constant designating the DNS namespace for UUIDs.
211
+ </para>
212
+ -->
213
+ <para>
120
214
代表 DNS 命令空间的 UUID 常量。
121
215
</para>
122
216
</entry>
123
217
</row>
124
218
<row>
125
219
<entry><literal>uuid_ns_url()</literal></entry>
126
220
<entry>
127
- <para>
221
+ <!--
222
+ <para>
223
+ Constant designating the URL namespace for UUIDs.
224
+ </para>
225
+ -->
226
+ <para>
128
227
代表 URL 命名空间的 UUID 常量。
129
228
</para>
130
229
</entry>
131
230
</row>
132
231
<row>
133
232
<entry><literal>uuid_ns_oid()</literal></entry>
134
233
<entry>
234
+ <!--
135
235
<para>
236
+ Constant designating the ISO object identifier (OID) namespace for
237
+ UUIDs. (This pertains to ASN.1 OIDs, which are unrelated to the OIDs
238
+ used in <productname>PostgreSQL</>.)
239
+ </para>
240
+ -->
241
+ <para>
136
242
代表 ISO 对象标识符(OID)命名空间的 UUID 常量。(它是 ASN.1 的 OID,和 <productname>PostgreSQL</> 用的 OID 没有关系)。
137
243
</para>
138
244
</entry>
139
245
</row>
140
246
<row>
141
247
<entry><literal>uuid_ns_x500()</literal></entry>
142
248
<entry>
143
- <para>
249
+ <!--
250
+ <para>
251
+ Constant designating the X.500 distinguished name (DN) namespace for
252
+ UUIDs.
253
+ </para>
254
+ -->
255
+ <para>
144
256
代表 X.500 识别名字(DN)命名空间的 UUID 常量
145
257
</para>
146
258
</entry>
@@ -151,7 +263,10 @@ SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
151
263
</sect2>
152
264
153
265
<sect2>
154
- <title>作者</title>
266
+ <!--
267
+ <title>Author</title>
268
+ -->
269
+ <title>作者</title>
155
270
156
271
<para>
157
272
Peter Eisentraut <email>peter_e@gmx.net</email>
0 commit comments