This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: uuid module generates incorrect values for uuid3 (and possibly uuid5)
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0, Python 2.6
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, dsm001, pwr
Priority: normal Keywords:

Created on 2009-03-04 07:28 by pwr, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg83118 - (view) Author: René Puls (pwr) Date: 2009-03-04 07:28
I am trying to recreate the sample output from appendix B of RFC 4122.

In that document, a version 3 UUID is created using the DNS namespace 
(6ba7b810-9dad-11d1-80b4-00c04fd430c8, same as uuid.NAMESPACE_DNS in 
Python) and the name ''.

The result according to the RFC should be:


Here is the output from the Python uuid module:

>>> import uuid
>>> uuid.uuid3(uuid.NAMESPACE_DNS, '')

I couldn't find any test cases for the Python module. Did I use it 
incorrectly, or is the calculation really off?
msg83290 - (view) Author: DSM (dsm001) Date: 2009-03-07 22:39
Hmm.  I quickly wrote my own implementation and I agree with the uuid
module and disagree with the RFC value.  

Further searching suggests that this may be an error in the RFC.  See ; see also for a
specific explanation of what probably caused the bug in the reference code.

I can reproduce the RFC value by (IMO incorrectly) flipping the
namespace endianness.

(It may be worth noting, though, that one of the links above points to
the python implementation for support-- so there could be a vicious
circle here. :^)
msg89986 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-07-01 15:57
I also found several threads saying that the RFC is wrong;
the current module returns the correct result.
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49665
2009-07-01 15:57:13amaury.forgeotdarcsetstatus: open -> closed

nosy: + amaury.forgeotdarc
messages: + msg89986

resolution: works for me
2009-03-07 22:39:38dsm001setnosy: + dsm001
messages: + msg83290
2009-03-04 07:28:58pwrcreate