1212
1313This module provides immutable :class: `UUID ` objects (the :class: `UUID ` class)
1414and the functions :func: `uuid1 `, :func: `uuid3 `, :func: `uuid4 `, :func: `uuid5 `,
15- and :func: `uuid. uuid8 ` for generating version 1, 3, 4, 5, and 8 UUIDs as
16- specified in :rfc: `9562 ` (which supersedes :rfc: `4122 `).
15+ :func: ` uuid6 `, and :func: `uuid8 ` for generating version 1, 3, 4, 5, 6,
16+ and 8 UUIDs as specified in :rfc: `9562 ` (which supersedes :rfc: `4122 `).
1717
1818If all you want is a unique ID, you should probably call :func: `uuid1 ` or
1919:func: `uuid4 `. Note that :func: `uuid1 ` may compromise privacy since it creates
@@ -153,8 +153,8 @@ which relays any information about the UUID's safety, using this enumeration:
153153 The UUID version number (1 through 8, meaningful only when the variant is
154154 :const: `RFC_4122 `).
155155
156- .. versionchanged :: 3.14
157- Added UUID version 8.
156+ .. versionchanged :: next
157+ Added UUID versions 6 and 8.
158158
159159
160160.. attribute :: UUID.is_safe
@@ -212,6 +212,22 @@ The :mod:`uuid` module defines the following functions:
212212 that will be encoded using UTF-8).
213213
214214
215+ .. function :: uuid6(node=None, clock_seq=None)
216+
217+ Generate a UUID from a sequence number and the current time according to
218+ :rfc: `9562 `.
219+ This is an alternative to :func: `uuid1 ` to improve database locality.
220+
221+ When *node * is not specified, :func: `getnode ` is used to obtain the hardware
222+ address as a 48-bit positive integer. When a sequence number *clock_seq * is
223+ not specified, a pseudo-random 14-bit positive integer is generated.
224+
225+ If *node * or *clock_seq * exceed their expected bit count, only their least
226+ significant bits are kept.
227+
228+ .. versionadded :: next
229+
230+
215231.. function :: uuid8(a=None, b=None, c=None)
216232
217233 Generate a pseudo-random UUID according to
@@ -314,7 +330,7 @@ The :mod:`uuid` module can be executed as a script from the command line.
314330
315331.. code-block :: sh
316332
317- python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid8}] [-n NAMESPACE] [-N NAME]
333+ python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6, uuid8}] [-n NAMESPACE] [-N NAME]
318334
319335 The following options are accepted:
320336
@@ -330,8 +346,8 @@ The following options are accepted:
330346 Specify the function name to use to generate the uuid. By default :func: `uuid4 `
331347 is used.
332348
333- .. versionadded :: 3.14
334- Allow generating UUID version 8.
349+ .. versionchanged :: next
350+ Allow generating UUID versions 6 and 8.
335351
336352.. option :: -n <namespace >
337353 --namespace <namespace>
0 commit comments