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
v1: get node_id automatically #740
base: main
Are you sure you want to change the base?
Conversation
Some prettification/tests/docs is remaining, but the bulk of the work is done. Feedback from maintainers would be appreciated, thanks! |
Hi @shivdhar! Thanks for the PR. I'm not sure this is something we should add to |
Hi @KodrAus ! I actually was surprised when I tried to use the crate and, instead of just calling Also I took a look at the history of the feature in this repo, and the only reason it seems it wasn't included since the beginning is this issue:
However, node ID is quite well defined in the RFC (along with fallback) so I don't see any reason why we shouldn't have a conformant implementation. Another blocker -- way back in 2016 -- seems to have been this:
This seems to have been solved by the mac_address crate though fairly well; it supports most common platforms and seems to be fairly popular and good at its job (over 2.4M downloads), so we're probably in a better place to provide this in 2024. Most other languages let us get a v1 UUID automatically without a mandatory Let me know what you think! |
I think discoverability is definitely an issue, but I also think that's solved by adding an example. My specific concerns with direct support are:
At least I'd like to start with an example, and consider revisiting this in the future if it becomes widely desirable. |
v1: Create node_id automatically from the MAC address of the machine, with fallback, according to the rules laid out by RFC 4122.
Advantage:
The user can now call
now_v1_auto()
and get a V1 UUID without needing to figure out how to manually retrieve/create thenode_id
.Performance: Comparable