I am trying to create a UUID that follows the RFC4122 requirements. The documentation for UUID v5 states:
uuid.uuid5(namespace, name)
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a string).
and
uuid.RFC_4122
Specifies the UUID layout given in RFC 4122.
I do not understand what the "name" in the explanation above is:
>>> import uuid
>>> uuid.uuid5(uuid.RFC_4122, 'hello')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python310\lib\uuid.py", line 720, in uuid5
hash = sha1(namespace.bytes + bytes(name, "utf-8")).digest()
AttributeError: 'str' object has no attribute 'bytes'
It is surprisingly difficult to find an example of the generation of this UUID (I could not find any, anywhere).