Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Alternative Namespaces for Name-Based UUID #53

Closed
kyzer-davis opened this issue Jan 20, 2023 · 3 comments
Closed

Discussion: Alternative Namespaces for Name-Based UUID #53

kyzer-davis opened this issue Jan 20, 2023 · 3 comments

Comments

@kyzer-davis
Copy link
Collaborator

We have DNS, URL, OID, and X500 as per RFC4122: https://www.rfc-editor.org/rfc/rfc4122#appendix-C

DNS  = 6ba7b810-9dad-11d1-80b4-00c04fd430c8
URL  = 6ba7b811-9dad-11d1-80b4-00c04fd430c8
OID  = 6ba7b812-9dad-11d1-80b4-00c04fd430c8
X500 = 6ba7b814-9dad-11d1-80b4-00c04fd430c8

These are basically "special case" UUIDv1 values incremented at the last octet of the time_low.
See: https://stackoverflow.com/questions/7724903/where-do-uuid-namespaces-come-from

From what I can see UUIDv3 and UUIDv5 Libraries will only implement what we define in the spec and do not allow for any inputs other than these four.

Some common use cases that come to mind for UUIDs where a "namespace" may need to be defined are:

  • IOT applications
  • Database applications

Does it make sense to add the following by incrementing to 6ba7b814 to 6ba7b815 and 6ba7b816

IOT = 6ba7b815-9dad-11d1-80b4-00c04fd430c8
DB  = 6ba7b816-9dad-11d1-80b4-00c04fd430c8
@LiosK
Copy link
Contributor

LiosK commented Jan 21, 2023

A little bit confused because IOT or DB doesn't look like a "namespace" (neither does X500 though). I think each IOT/DB/whatever application should generate a UUID and use it as its own application-specific namespace ID. For example:

DB_APP_A_USER_ID_SPACE = "c8158cdd-8ad5-477c-ab51-57703a54d286"  # v4 I made up just now
DB_APP_B_USER_ID_SPACE = "a79c6917-619f-4e8c-abcf-170a6116878d"  # ditto

uuidv5_a = gen_uuidv5(name_space_id=DB_APP_A_USER_ID_SPACE, name="LiosK")
uuidv5_b = gen_uuidv5(name_space_id=DB_APP_B_USER_ID_SPACE, name="LiosK")

A predefined namespace ID that might be shared by multiple applications/namespaces doesn't seem useful here.

@kyzer-davis
Copy link
Collaborator Author

@LiosK, while that should be true, the point I was making is that almost no library implements a "generic enter your own namespace" option. Where most are hardcoded to whatever is in RFC4122.

This at least gives a few more options, although probably not needed at all. I just wanted to at least bring it up while revising the spec.

@kyzer-davis
Copy link
Collaborator Author

I opted to add some text around the topic of allowing custom inputs for namespace rather than JUST what is in the document without adding any new items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants