0
According to the Python documentation if you want to create unique Ids you should probably use uuid1 or the uuid4 taking into account that the first option can compromise privacy by creating a UUID
containing the host’s MAC address, while the second creates a UUID
random.
- uuid1: Generate from the host machine’s MAC address plus a sentence containing the sequence number (if you cannot get the sequence, a 14-bit number is generated randomly) and the current time
- uuid2: Generates a random UUID.
Why not use uuid3 or uuid5?
To create unique Ids it is not advisable to use the uuid3 and the uuid5 because the first is based on the MD5 hash of a namespace identifier (which is a UUID) and a name (which is a string). The second one does the same but uses the SHA-1 hash.
Note: The nome
used in the generation of uuid3
and uuid5
may be a domain, a URL, an OID (Identification Object) or a X.500DN
or an output text format.
They are not random Python implementations, they are in fact all standard UUID specifications. Each uses different input parameters.
– Matheus