-
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathuuid.po
More file actions
704 lines (625 loc) · 28.3 KB
/
uuid.po
File metadata and controls
704 lines (625 loc) · 28.3 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-07 00:19+0000\n"
"PO-Revision-Date: 2018-05-23 16:15+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/uuid.rst:2
msgid ":mod:`!uuid` --- UUID objects according to :rfc:`9562`"
msgstr ":mod:`!uuid` --- :rfc:`9562` 定義的 UUID 物件"
#: ../../library/uuid.rst:9
msgid "**Source code:** :source:`Lib/uuid.py`"
msgstr "**原始碼:**\\ :source:`Lib/uuid.py`"
#: ../../library/uuid.rst:13
msgid ""
"This module provides immutable :class:`UUID` objects (the :class:`UUID` "
"class) and :ref:`functions <uuid-factory-functions>` for generating UUIDs "
"corresponding to a specific UUID version as specified in :rfc:`9562` (which "
"supersedes :rfc:`4122`), for example, :func:`uuid1` for UUID version 1, :"
"func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is "
"deliberately omitted as it is outside the scope of the RFC."
msgstr ""
"這個模組提供了不可變的 :class:`UUID` 物件(:class:`UUID` 類別)和用於生成對應於 "
":rfc:`9562`\\ (取代了 :rfc:`4122`)中指定的特定 UUID 版本的 "
":ref:`函式 <uuid-factory-functions>`,例如 UUID 版本 1 的 :func:`uuid1`、"
"UUID 版本 3 的 :func:`uuid3` 等等。需要注意的是,UUID 版本 2 被故意省略,因為它不在 RFC 的範圍內。"
#: ../../library/uuid.rst:19
msgid ""
"If all you want is a unique ID, you should probably call :func:`uuid1` or :"
"func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it "
"creates a UUID containing the computer's network address. :func:`uuid4` "
"creates a random UUID."
msgstr ""
"如果你只需要一個唯一的 ID,你應該呼叫 :func:`uuid1` 或 :func:`uuid4`。需要注"
"意的是,:func:`uuid1` 可能會危害隱私,因為它會建立一個包含了電腦網路位址的 "
"UUID。而 :func:`uuid4` 則會建立一個隨機的 UUID。"
#: ../../library/uuid.rst:24
msgid ""
"Depending on support from the underlying platform, :func:`uuid1` may or may "
"not return a \"safe\" UUID. A safe UUID is one which is generated using "
"synchronization methods that ensure no two processes can obtain the same "
"UUID. All instances of :class:`UUID` have an :attr:`~UUID.is_safe` "
"attribute which relays any information about the UUID's safety, using this "
"enumeration:"
msgstr ""
"根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」"
"UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程取得到相同的 "
"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`~UUID.is_safe` 屬性,該屬性使"
"用下面這個列舉來傳遞有關 UUID 安全性的任何資訊:"
#: ../../library/uuid.rst:36
msgid "The UUID was generated by the platform in a multiprocessing-safe way."
msgstr "該 UUID 是由平台以多行程安全的 (multiprocessing-safe) 方式生成的。"
#: ../../library/uuid.rst:40
msgid "The UUID was not generated in a multiprocessing-safe way."
msgstr "該 UUID 不是以多行程安全的方式生成的。"
#: ../../library/uuid.rst:44
msgid ""
"The platform does not provide information on whether the UUID was generated "
"safely or not."
msgstr "該平台不提供 UUID 是否為安全生成的資訊。"
#: ../../library/uuid.rst:49
msgid ""
"Create a UUID from either a string of 32 hexadecimal digits, a string of 16 "
"bytes in big-endian order as the *bytes* argument, a string of 16 bytes in "
"little-endian order as the *bytes_le* argument, a tuple of six integers (32-"
"bit *time_low*, 16-bit *time_mid*, 16-bit *time_hi_version*, 8-bit "
"*clock_seq_hi_variant*, 8-bit *clock_seq_low*, 48-bit *node*) as the "
"*fields* argument, or a single 128-bit integer as the *int* argument. When a "
"string of hex digits is given, curly braces, hyphens, and a URN prefix are "
"all optional. For example, these expressions all yield the same UUID::"
msgstr ""
"從以下其中一種引數來建立 UUID:由 32 個十六進位的數字組成的字串、以大端順序 "
"(big-endian) 排列的 16 個位元組組成的字串作為 *bytes* 引數、以小端順序 "
"(little-endian) 排列的 16 個位元組組成的字串作為 *bytes_le* 引數、由 6 個整數"
"(32 位元的 *time_low*、16 位元的 *time_mid*、16 位元的 *time_hi_version*、8 "
"位元的 *clock_seq_hi_variant*、8 位元的 *clock_seq_low*、48 位元的 *node*)組"
"成的元組 (tuple) 作為 *fields* 引數,或者是單一的 128 位元整數作為 *int* 引"
"數。當給定由十六進位的數字組成的字串時,大括號、連字符號和 URN 前綴都是可以選"
"用的。例如,以下這些運算式都會產生相同的 UUID: ::"
#: ../../library/uuid.rst:59
msgid ""
"UUID('{12345678-1234-5678-1234-567812345678}')\n"
"UUID('12345678123456781234567812345678')\n"
"UUID('urn:uuid:12345678-1234-5678-1234-567812345678')\n"
"UUID(bytes=b'\\x12\\x34\\x56\\x78'*4)\n"
"UUID(bytes_le=b'\\x78\\x56\\x34\\x12\\x34\\x12\\x78\\x56' +\n"
" b'\\x12\\x34\\x56\\x78\\x12\\x34\\x56\\x78')\n"
"UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))\n"
"UUID(int=0x12345678123456781234567812345678)"
msgstr ""
"UUID('{12345678-1234-5678-1234-567812345678}')\n"
"UUID('12345678123456781234567812345678')\n"
"UUID('urn:uuid:12345678-1234-5678-1234-567812345678')\n"
"UUID(bytes=b'\\x12\\x34\\x56\\x78'*4)\n"
"UUID(bytes_le=b'\\x78\\x56\\x34\\x12\\x34\\x12\\x78\\x56' +\n"
" b'\\x12\\x34\\x56\\x78\\x12\\x34\\x56\\x78')\n"
"UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))\n"
"UUID(int=0x12345678123456781234567812345678)"
#: ../../library/uuid.rst:68
msgid ""
"Exactly one of *hex*, *bytes*, *bytes_le*, *fields*, or *int* must be given. "
"The *version* argument is optional; if given, the resulting UUID will have "
"its variant and version number set according to :rfc:`9562`, overriding bits "
"in the given *hex*, *bytes*, *bytes_le*, *fields*, or *int*."
msgstr ""
"必須正好給定其中一個引數 *hex*、*bytes*、*bytes_le*、*fields* 或 *int*。"
"*version* 引數是選用的;如果給定了該引數,生成的 UUID 將根據 :rfc:`9562` 設置"
"其變體 (variant) 和版本號,覆蓋掉給定的 *hex*、*bytes*、*bytes_le*、*fields* "
"或 *int* 中的位元。"
#: ../../library/uuid.rst:73
msgid ""
"Comparison of UUID objects are made by way of comparing their :attr:`UUID."
"int` attributes. Comparison with a non-UUID object raises a :exc:"
"`TypeError`."
msgstr ""
"UUID 物件之間的比較是透過比較它們的 :attr:`UUID.int` 屬性。與非 UUID 的物件進"
"行比較會引發 :exc:`TypeError`。"
#: ../../library/uuid.rst:77
msgid ""
"``str(uuid)`` returns a string in the form "
"``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits "
"represent the UUID."
msgstr ""
"``str(uuid)`` 會回傳一個像是 ``12345678-1234-5678-1234-567812345678`` 形式的"
"字串,其中 32 個十六進位的數字代表 UUID。"
#: ../../library/uuid.rst:81
msgid ":class:`UUID` instances have these read-only attributes:"
msgstr ":class:`UUID` 實例有以下唯讀的屬性:"
#: ../../library/uuid.rst:85
msgid ""
"The UUID as a 16-byte string (containing the six integer fields in big-"
"endian byte order)."
msgstr ""
"UUID 以 16 位元組的字串表示(包含 6 個整數欄位,按照大端位元組順序排列)。"
#: ../../library/uuid.rst:91
msgid ""
"The UUID as a 16-byte string (with *time_low*, *time_mid*, and "
"*time_hi_version* in little-endian byte order)."
msgstr ""
"UUID 以 16 位元組的字串表示(其中 *time_low*、*time_mid* 和 "
"*time_hi_version* 按照小端位元組順序排列)。"
#: ../../library/uuid.rst:97
msgid ""
"A tuple of the six integer fields of the UUID, which are also available as "
"six individual attributes and two derived attributes:"
msgstr ""
"UUID 以 6 個整數欄位所組成的元組表示,也可以看作有 6 個個別屬性和 2 個衍生屬"
"性:"
#: ../../library/uuid.rst:102
msgid "Field"
msgstr "欄位"
#: ../../library/uuid.rst:103
msgid "Meaning"
msgstr "意義"
#: ../../library/uuid.rst:106
msgid "The first 32 bits of the UUID. Only relevant to version 1."
msgstr "UUID 的前 32 位元。只與版本 1 有關。"
#: ../../library/uuid.rst:109 ../../library/uuid.rst:112
msgid "The next 16 bits of the UUID. Only relevant to version 1."
msgstr "UUID 接下來的 16 位元。只與版本 1 有關。"
#: ../../library/uuid.rst:115 ../../library/uuid.rst:118
msgid "The next 8 bits of the UUID. Only relevant to versions 1 and 6."
msgstr "UUID 接下來的 8 位元。只與版本 1 和 6 有關。"
#: ../../library/uuid.rst:121
msgid "The last 48 bits of the UUID. Only relevant to version 1."
msgstr "UUID 最後的 48 位元。只與版本 1 有關。"
#: ../../library/uuid.rst:124
msgid ""
"The 60-bit timestamp as a count of 100-nanosecond intervals since Gregorian "
"epoch (1582-10-15 00:00:00) for versions 1 and 6, or the 48-bit timestamp in "
"milliseconds since Unix epoch (1970-01-01 00:00:00) for version 7."
msgstr ""
"60 位元的時間戳,對於版本 1 和 6 是自格里高利紀元 (Gregorian Epoch, 1582-10-15 00:00"
":00) 起以 100 奈秒為單位的計數,對於版本 7 是自 Unix 紀元 (1970-01-01 00:00:00) "
"起以毫秒為單位的計數。"
#: ../../library/uuid.rst:130
msgid "The 14-bit sequence number. Only relevant to versions 1 and 6."
msgstr "14 位元的序列號。只與版本 1 和 6 有關。"
#: ../../library/uuid.rst:135
msgid "The UUID as a 32-character lowercase hexadecimal string."
msgstr "UUID 以 32 個小寫十六進位字元組成的字串表示。"
#: ../../library/uuid.rst:140
msgid "The UUID as a 128-bit integer."
msgstr "UUID 以 128 位元的整數表示。"
#: ../../library/uuid.rst:145
msgid "The UUID as a URN as specified in :rfc:`9562`."
msgstr "UUID 以 :rfc:`9562` 中指定的 URN 形式表示。"
#: ../../library/uuid.rst:150
msgid ""
"The UUID variant, which determines the internal layout of the UUID. This "
"will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :"
"const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`."
msgstr ""
"UUID 的變體,決定 UUID 內部的佈局 (layout),是 :const:`RESERVED_NCS`、:const:"
"`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個"
"常數。"
#: ../../library/uuid.rst:157
msgid ""
"The UUID version number (1 through 8, meaningful only when the variant is :"
"const:`RFC_4122`)."
msgstr "UUID 的版本號(1 到 8,只有當變體是 :const:`RFC_4122` 時才有意義)。"
#: ../../library/uuid.rst:160
msgid "Added UUID versions 6, 7 and 8."
msgstr "新增了 UUID 版本 6、7 和 8。"
#: ../../library/uuid.rst:166
msgid ""
"An enumeration of :class:`SafeUUID` which indicates whether the platform "
"generated the UUID in a multiprocessing-safe way."
msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。"
#: ../../library/uuid.rst:171
msgid "The :mod:`!uuid` module defines the following functions:"
msgstr ":mod:`!uuid` 模組定義了以下函式:"
#: ../../library/uuid.rst:176
msgid ""
"Get the hardware address as a 48-bit positive integer. The first time this "
"runs, it may launch a separate program, which could be quite slow. If all "
"attempts to obtain the hardware address fail, we choose a random 48-bit "
"number with the multicast bit (least significant bit of the first octet) set "
"to 1 as recommended in :rfc:`4122`. \"Hardware address\" means the MAC "
"address of a network interface. On a machine with multiple network "
"interfaces, universally administered MAC addresses (i.e. where the second "
"least significant bit of the first octet is *unset*) will be preferred over "
"locally administered MAC addresses, but with no other ordering guarantees."
msgstr ""
"取得 48 位元正整數形式的硬體位址。第一次執行時,有可能會啟動一個獨立的程式,"
"這也許會相當耗時。如果所有取得硬體位址的嘗試都失敗,我們會根據 :rfc:`4122` 中"
"的建議,使用一個 48 位元的隨機數,其中群播位元 (multicast bit)(第一個八位元"
"組的最低有效位)設置為 1。「硬體位址」指的是網路介面 (network interface) 的 "
"MAC 位址。在具有多個網路介面的機器上,將優先選擇通用管理 (universally "
"administered) 的 MAC 位址(即第一個八位元組的第二個最低有效位是 *未設置的"
"*),而不是本地管理 (locally administered) 的 MAC 位址,除此之外不保證任何選"
"擇的順序。"
#: ../../library/uuid.rst:186
msgid ""
"Universally administered MAC addresses are preferred over locally "
"administered MAC addresses, since the former are guaranteed to be globally "
"unique, while the latter are not."
msgstr ""
"通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者"
"不是。"
#: ../../library/uuid.rst:196
msgid ""
"Generate a UUID from a host ID, sequence number, and the current time "
"according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.1 <9562#section-5.1>`,從主機 ID、序列號碼和當前時間"
"產生 UUID。"
#: ../../library/uuid.rst:199 ../../library/uuid.rst:236
msgid ""
"When *node* is not specified, :func:`getnode` is used to obtain the hardware "
"address as a 48-bit positive integer. When a sequence number *clock_seq* is "
"not specified, a pseudo-random 14-bit positive integer is generated."
msgstr ""
"如果未指定 *node*,則使用 :func:`getnode` 取得硬體地址,作為 48 位元的正整數。"
"如果未指定序列號碼 *clock_seq*,則生成一個偽隨機的 14 位元正整數。"
#: ../../library/uuid.rst:203 ../../library/uuid.rst:240
msgid ""
"If *node* or *clock_seq* exceed their expected bit count, only their least "
"significant bits are kept."
msgstr ""
"如果 *node* 或 *clock_seq* 超過了預期的位元數,則只保留它們的最低有效位元。"
#: ../../library/uuid.rst:209
msgid ""
"Generate a UUID based on the MD5 hash of a namespace identifier (which is a "
"UUID) and a name (which is a :class:`bytes` object or a string that will be "
"encoded using UTF-8) according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.3 <9562#section-5.3>`,基於命名空間識別碼 (namespace "
"identifier)(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 編碼的字"
"串)的 MD5 hash 來生成 UUID。"
#: ../../library/uuid.rst:217
msgid ""
"Generate a random UUID in a cryptographically-secure method according to :"
"rfc:`RFC 9562, §5.4 <9562#section-5.4>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.4 <9562#section-5.4>`,以加密安全的方式生成一個隨機 UUID。"
#: ../../library/uuid.rst:223
msgid ""
"Generate a UUID based on the SHA-1 hash of a namespace identifier (which is "
"a UUID) and a name (which is a :class:`bytes` object or a string that will "
"be encoded using UTF-8) according to :rfc:`RFC 9562, §5.5 "
"<9562#section-5.5>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.5 <9562#section-5.5>`,基於命名空間識別碼(一個 "
"UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 編碼的字串)的 SHA-1 hash "
"來生成 UUID。"
#: ../../library/uuid.rst:231
msgid ""
"Generate a UUID from a sequence number and the current time according to :"
"rfc:`RFC 9562, §5.6 <9562#section-5.6>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.6 <9562#section-5.6>`,從序列號和當前時間產生 UUID。"
#: ../../library/uuid.rst:234
msgid "This is an alternative to :func:`uuid1` to improve database locality."
msgstr ""
"這是 :func:`uuid1` 的替代方案,以改善資料庫的局部性 (locality)。"
#: ../../library/uuid.rst:248
msgid ""
"Generate a time-based UUID according to :rfc:`RFC 9562, §5.7 "
"<9562#section-5.7>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.7 <9562#section-5.7>`,生成基於時間的 UUID。"
#: ../../library/uuid.rst:251
msgid ""
"For portability across platforms lacking sub-millisecond precision, UUIDs "
"produced by this function embed a 48-bit timestamp and use a 42-bit counter "
"to guarantee monotonicity within a millisecond."
msgstr ""
"為了在缺乏微秒精度的平台上具有可移植性,此函式生成的 UUID 嵌入了 48 位元的時間戳記,"
"並使用 42 位元的計數器來保證在毫秒內的單調性。"
#: ../../library/uuid.rst:260
msgid ""
"Generate a pseudo-random UUID according to :rfc:`RFC 9562, §5.8 "
"<9562#section-5.8>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.8 <9562#section-5.8>`,生成一個偽隨機 UUID。"
#: ../../library/uuid.rst:263
msgid ""
"When specified, the parameters *a*, *b* and *c* are expected to be positive "
"integers of 48, 12 and 62 bits respectively. If they exceed their expected "
"bit count, only their least significant bits are kept; non-specified "
"arguments are substituted for a pseudo-random integer of appropriate size."
msgstr ""
"當指定時,參數 *a*、*b* 和 *c* 預期為分別為 48、12 和 62 位元的正整數。如果它們超"
"過了預期的位元數,則只保留它們的最低有效位元;未指定的參數將被替換為適當大小的偽隨機整數。"
#: ../../library/uuid.rst:269
msgid ""
"By default, *a*, *b* and *c* are not generated by a cryptographically secure "
"pseudo-random number generator (CSPRNG). Use :func:`uuid4` when a UUID needs "
"to be used in a security-sensitive context."
msgstr ""
"預設情況下,*a*、*b* 和 *c* 並非由加密安全的偽隨機數生成器 (CSPRNG) 生成。"
"當 UUID 需要在安全敏感的情境中使用時,請使用 :func:`uuid4`。"
#: ../../library/uuid.rst:276
msgid ""
"The :mod:`!uuid` module defines the following namespace identifiers for use "
"with :func:`uuid3` or :func:`uuid5`."
msgstr ""
":mod:`!uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別"
"碼。"
#: ../../library/uuid.rst:282
msgid ""
"When this namespace is specified, the *name* string is a fully qualified "
"domain name."
msgstr ""
"當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain "
"name)。"
#: ../../library/uuid.rst:288
msgid "When this namespace is specified, the *name* string is a URL."
msgstr "當指定這個命名空間時,*name* 字串是一個 URL。"
#: ../../library/uuid.rst:293
msgid "When this namespace is specified, the *name* string is an ISO OID."
msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。"
#: ../../library/uuid.rst:298
msgid ""
"When this namespace is specified, the *name* string is an X.500 DN in DER or "
"a text output format."
msgstr ""
"當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。"
#: ../../library/uuid.rst:301
msgid ""
"The :mod:`!uuid` module defines the following constants for the possible "
"values of the :attr:`~UUID.variant` attribute:"
msgstr ":mod:`!uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:"
#: ../../library/uuid.rst:307
msgid "Reserved for NCS compatibility."
msgstr "保留供 NCS 相容性使用。"
#: ../../library/uuid.rst:312
msgid ""
"Specifies the UUID layout given in :rfc:`4122`. This constant is kept for "
"backward compatibility even though :rfc:`4122` has been superseded by :rfc:"
"`9562`."
msgstr ""
"指定 :rfc:`4122` 中給出的 UUID 佈局。即使 :rfc:`4122` 已被 :rfc:`9562` 取代,"
"這個常數仍然保留以保持向後相容性。"
#: ../../library/uuid.rst:319
msgid "Reserved for Microsoft compatibility."
msgstr "保留供 Microsoft 相容性使用。"
#: ../../library/uuid.rst:324
msgid "Reserved for future definition."
msgstr "保留供未來定義使用。"
#: ../../library/uuid.rst:327
msgid "The :mod:`!uuid` module defines the special Nil and Max UUID values:"
msgstr ":mod:`!uuid` 模組定義了特殊的 Nil 和 Max UUID 值:"
#: ../../library/uuid.rst:332
msgid ""
"A special form of UUID that is specified to have all 128 bits set to zero "
"according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.9 <9562#section-5.9>`,一種特殊形式的 UUID,"
"被指定為所有 128 位元都設置為零。"
#: ../../library/uuid.rst:340
msgid ""
"A special form of UUID that is specified to have all 128 bits set to one "
"according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`."
msgstr ""
"根據 :rfc:`RFC 9562, §5.10 <9562#section-5.10>`,一種特殊形式的 UUID,"
"被指定為所有 128 位元都設置為一。"
#: ../../library/uuid.rst:348
msgid ":rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace"
msgstr ""
":rfc:`9562` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命"
"名空間"
#: ../../library/uuid.rst:349
msgid ""
"This specification defines a Uniform Resource Name namespace for UUIDs, the "
"internal format of UUIDs, and methods of generating UUIDs."
msgstr ""
"這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的"
"內部格式和生成 UUID 的方法。"
#: ../../library/uuid.rst:356
msgid "Command-Line Usage"
msgstr "命令列的用法"
#: ../../library/uuid.rst:360
msgid ""
"The :mod:`!uuid` module can be executed as a script from the command line."
msgstr ":mod:`!uuid` 模組可以在命令列下作為腳本來執行。"
#: ../../library/uuid.rst:362
msgid ""
"python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6,uuid7,uuid8}] [-n "
"NAMESPACE] [-N NAME]"
msgstr ""
"python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6,uuid7,uuid8}] [-n "
"NAMESPACE] [-N NAME]"
#: ../../library/uuid.rst:366
msgid "The following options are accepted:"
msgstr "可以接受以下選項:"
#: ../../library/uuid.rst:372
msgid "Show the help message and exit."
msgstr "顯示幫助訊息並退出。"
#: ../../library/uuid.rst:377
msgid ""
"Specify the function name to use to generate the uuid. By default :func:"
"`uuid4` is used."
msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。"
#: ../../library/uuid.rst:380
msgid "Allow generating UUID versions 6, 7 and 8."
msgstr "允許生成 UUID 版本 6、7 和 8。"
#: ../../library/uuid.rst:386
msgid ""
"The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known "
"predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, "
"``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` "
"functions."
msgstr ""
"該命名空間是一個 ``UUID`` 或 ``@ns``,其中 ``ns`` 是指知名預定義 UUID 的命名"
"空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:"
"`uuid3` / :func:`uuid5` 函式會需要。"
#: ../../library/uuid.rst:393
msgid ""
"The name used as part of generating the uuid. Only required for :func:"
"`uuid3` / :func:`uuid5` functions."
msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。"
#: ../../library/uuid.rst:399
msgid "Generate *num* fresh UUIDs."
msgstr "生成 *num* 個新 UUID。"
#: ../../library/uuid.rst:407
msgid "Example"
msgstr "範例"
#: ../../library/uuid.rst:409
msgid "Here are some examples of typical usage of the :mod:`!uuid` module::"
msgstr "以下是一些 :mod:`!uuid` 模組的典型使用範例: ::"
#: ../../library/uuid.rst:411
msgid ""
">>> import uuid\n"
"\n"
">>> # make a UUID based on the host ID and current time\n"
">>> uuid.uuid1()\n"
"UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')\n"
"\n"
">>> # make a UUID using an MD5 hash of a namespace UUID and a name\n"
">>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')\n"
"UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')\n"
"\n"
">>> # make a random UUID\n"
">>> uuid.uuid4()\n"
"UUID('16fd2706-8baf-433b-82eb-8c7fada847da')\n"
"\n"
">>> # make a UUID using a SHA-1 hash of a namespace UUID and a name\n"
">>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')\n"
"UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')\n"
"\n"
">>> # make a UUID from a string of hex digits (braces and hyphens ignored)\n"
">>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')\n"
"\n"
">>> # convert a UUID to a string of hex digits in standard form\n"
">>> str(x)\n"
"'00010203-0405-0607-0809-0a0b0c0d0e0f'\n"
"\n"
">>> # get the raw 16 bytes of the UUID\n"
">>> x.bytes\n"
"b'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f'\n"
"\n"
">>> # make a UUID from a 16-byte string\n"
">>> uuid.UUID(bytes=x.bytes)\n"
"UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')\n"
"\n"
">>> # get the Nil UUID\n"
">>> uuid.NIL\n"
"UUID('00000000-0000-0000-0000-000000000000')\n"
"\n"
">>> # get the Max UUID\n"
">>> uuid.MAX\n"
"UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')\n"
"\n"
">>> # same as UUIDv1 but with fields reordered to improve DB locality\n"
">>> uuid.uuid6()\n"
"UUID('1f0799c0-98b9-62db-92c6-a0d365b91053')\n"
"\n"
">>> # get UUIDv7 creation (local) time as a timestamp in milliseconds\n"
">>> u = uuid.uuid7()\n"
">>> u.time\n"
"1743936859822\n"
"\n"
">>> # get UUIDv7 creation (local) time as a datetime object\n"
">>> import datetime as dt\n"
">>> dt.datetime.fromtimestamp(u.time / 1000)\n"
"datetime.datetime(...)\n"
"\n"
">>> # make a UUID with custom blocks\n"
">>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344)\n"
"UUID('00001234-5678-8ef0-8000-000011223344')"
msgstr ""
">>> import uuid\n"
"\n"
">>> # 基於主機 ID 和目前時間生成 UUID\n"
">>> uuid.uuid1()\n"
"UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')\n"
"\n"
">>> # 使用命名空間 UUID 的 MD5 雜湊和一個名稱生成 UUID\n"
">>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')\n"
"UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')\n"
"\n"
">>> # 生成一個隨機的 UUID\n"
">>> uuid.uuid4()\n"
"UUID('16fd2706-8baf-433b-82eb-8c7fada847da')\n"
"\n"
">>> # 使用命名空間 UUID 的 SHA-1 雜湊和一個名稱生成 UUID\n"
">>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')\n"
"UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')\n"
"\n"
">>> # 從十六進位數字組成的字串生成 UUID(大括號和連字符號會被忽略)\n"
">>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')\n"
"\n"
">>> # 將 UUID 轉換為標準形式的十六進位數字字串\n"
">>> str(x)\n"
"'00010203-0405-0607-0809-0a0b0c0d0e0f'\n"
"\n"
">>> # 取得 UUID 的原始 16 位元組\n"
">>> x.bytes\n"
"b'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f'\n"
"\n"
">>> # 從 16 位元組的字串生成 UUID\n"
">>> uuid.UUID(bytes=x.bytes)\n"
"UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')\n"
"\n"
">>> # 取得 Nil UUID\n"
">>> uuid.NIL\n"
"UUID('00000000-0000-0000-0000-000000000000')\n"
"\n"
">>> # 取得 Max UUID\n"
">>> uuid.MAX\n"
"UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')\n"
"\n"
">>> # 和 UUIDv1 相同但欄位重新排序以改善資料庫區域性\n"
">>> uuid.uuid6()\n"
"UUID('1f0799c0-98b9-62db-92c6-a0d365b91053')\n"
"\n"
">>> # 取得 UUIDv7 建立(本地)時間的毫秒時間戳\n"
">>> u = uuid.uuid7()\n"
">>> u.time\n"
"1743936859822\n"
"\n"
">>> # 取得 UUIDv7 建立(本地)時間的 datetime 物件\n"
">>> import datetime as dt\n"
">>> dt.datetime.fromtimestamp(u.time / 1000)\n"
"datetime.datetime(...)\n"
"\n"
">>> # 建立一個具有自訂區塊的 UUID\n"
">>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344)\n"
"UUID('00001234-5678-8ef0-8000-000011223344')"
#: ../../library/uuid.rst:474
msgid "Command-Line Example"
msgstr "命令列的範例"
#: ../../library/uuid.rst:476
msgid ""
"Here are some examples of typical usage of the :mod:`!uuid` command-line "
"interface:"
msgstr "以下是一些 :mod:`!uuid` 命令列介面的典型使用範例:"
#: ../../library/uuid.rst:478
msgid ""
"# generate a random UUID - by default uuid4() is used\n"
"$ python -m uuid\n"
"\n"
"# generate a UUID using uuid1()\n"
"$ python -m uuid -u uuid1\n"
"\n"
"# generate a UUID using uuid5\n"
"$ python -m uuid -u uuid5 -n @url -N example.com\n"
"\n"
"# generate 42 random UUIDs\n"
"$ python -m uuid -C 42"
msgstr ""
"# 生成一個隨機的 UUID - 預設使用 uuid4()\n"
"$ python -m uuid\n"
"\n"
"# 使用 uuid1() 生成一組 UUID\n"
"$ python -m uuid -u uuid1\n"
"\n"
"# 使用 uuid5 生成一組 UUID\n"
"$ python -m uuid -u uuid5 -n @url -N example.com\n"
"\n"
"# 生成 42 個隨機 UUID\n"
"$ python -m uuid -C 42"