Skip to content

Commit 8680fa4

Browse files
authored
Update uuid.rst
1 parent c555123 commit 8680fa4

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Doc/library/uuid.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,35 +193,42 @@ The :mod:`uuid` module defines the following functions:
193193

194194
.. function:: uuid1(node=None, clock_seq=None)
195195

196-
Generate a UUID from a host ID, sequence number, and the current time. If *node*
197-
is not given, :func:`getnode` is used to obtain the hardware address. If
198-
*clock_seq* is given, it is used as the sequence number; otherwise a random
196+
Generate a UUID from a host ID, sequence number, and the current time
197+
according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`.
198+
199+
If *node* is not given, :func:`getnode` is used to obtain the hardware address.
200+
201+
If *clock_seq* is given, it is used as the sequence number; otherwise a random
199202
14-bit sequence number is chosen.
200203

201204

202205
.. function:: uuid3(namespace, name)
203206

204207
Generate a UUID based on the MD5 hash of a namespace identifier (which is a
205208
UUID) and a name (which is a :class:`bytes` object or a string
206-
that will be encoded using UTF-8).
209+
that will be encoded using UTF-8)
210+
according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`.
207211

208212

209213
.. function:: uuid4()
210214

211-
Generate a random UUID.
215+
Generate a random UUID in a cryptographically-secure method
216+
according to :rfc:`RFC 9562, §5.4 <9562#section-5.4>`.
212217

213218

214219
.. function:: uuid5(namespace, name)
215220

216221
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a
217222
UUID) and a name (which is a :class:`bytes` object or a string
218-
that will be encoded using UTF-8).
223+
that will be encoded using UTF-8)
224+
according to :rfc:`RFC 9562, §5.5 <9562#section-5.5>`.
219225

220226

221227
.. function:: uuid6(node=None, clock_seq=None)
222228

223229
Generate a UUID from a sequence number and the current time according to
224-
:rfc:`9562`.
230+
:rfc:`RFC 9562, §5.6 <9562#section-5.6>`.
231+
225232
This is an alternative to :func:`uuid1` to improve database locality.
226233

227234
When *node* is not specified, :func:`getnode` is used to obtain the hardware

0 commit comments

Comments
 (0)