|
12 | 12 |
|
13 | 13 | This module provides immutable :class:`UUID` objects (the :class:`UUID` class) |
14 | 14 | and the functions :func:`uuid1`, :func:`uuid3`, :func:`uuid4`, :func:`uuid5` for |
15 | | -generating version 1, 3, 4, 5, and 8 UUIDs as specified in :rfc:`9562`. |
| 15 | +generating version 1, 3, 4, 5, and 8 UUIDs as specified in :rfc:`9562` (which |
| 16 | +superseeds :rfc:`4122`). |
16 | 17 |
|
17 | 18 | If all you want is a unique ID, you should probably call :func:`uuid1` or |
18 | 19 | :func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates |
@@ -172,7 +173,7 @@ The :mod:`uuid` module defines the following functions: |
172 | 173 | runs, it may launch a separate program, which could be quite slow. If all |
173 | 174 | attempts to obtain the hardware address fail, we choose a random 48-bit |
174 | 175 | number with the multicast bit (least significant bit of the first octet) |
175 | | - set to 1 as recommended in :rfc:`9562`. "Hardware address" means the MAC |
| 176 | + set to 1 as recommended in :rfc:`4122`. "Hardware address" means the MAC |
176 | 177 | address of a network interface. On a machine with multiple network |
177 | 178 | interfaces, universally administered MAC addresses (i.e. where the second |
178 | 179 | least significant bit of the first octet is *unset*) will be preferred over |
@@ -223,7 +224,14 @@ The :mod:`uuid` module defines the following functions: |
223 | 224 |
|
224 | 225 | .. function:: uuid8(a=None, b=None, c=None) |
225 | 226 |
|
226 | | - TODO |
| 227 | + Generate a pseudo-random UUID according to |
| 228 | + :rfc:`RFC 9562, §5.8 <9562#section-5.8>`. |
| 229 | + |
| 230 | + When specified, the parameters *a*, *b* and *c* are expected to be |
| 231 | + positive integers of 48, 12 and 62 bits respectively. If they exceed |
| 232 | + their expected bit count, only their least significant bits are kept; |
| 233 | + non-specified arguments are substituted for a pseudo-random integer of |
| 234 | + appropriate size. |
227 | 235 |
|
228 | 236 | .. versionadded:: 3.14 |
229 | 237 |
|
@@ -299,7 +307,7 @@ The :mod:`uuid` module can be executed as a script from the command line. |
299 | 307 |
|
300 | 308 | .. code-block:: sh |
301 | 309 |
|
302 | | - python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-n NAMESPACE] [-N NAME] |
| 310 | + python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid8}] [-n NAMESPACE] [-N NAME] |
303 | 311 |
|
304 | 312 | The following options are accepted: |
305 | 313 |
|
|
0 commit comments