-
Notifications
You must be signed in to change notification settings - Fork 191
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
added Uuid v1 with random node support #59
Conversation
Unfortunately the |
The "node" and "clock_seq" as given arguments are already in the fn "get_v1", I changed it's name to "new_v1_of". then added another commit to init the static_node use std::sync::{ONCE_INIT, Once}, is it ok that I've added an "extern crate std"? |
Ah sorry, I mean that this should continue to not have a dependency on either |
pub fn new_v1(timestamp: u64, clock_seq: Option<&[u8; 2]>, node: &[u8; 6]) -> Uuid {...
9108a02 seems some usless, and it's almost the same as "from_fields". |
Yeah I was thinking something like that (although also not having optional parameters which were in turn randomly generated). I don't think we're really poised to fully provide V1 UUID generation because we don't have a robust method of figuring out what the local MAC address is? |
close for now |
added Uuid v1 with random node support
TODO: support generate node with a real MAC.
In fact in some situations such as in docker, the MAC is virtual. so I think to use a random node seem to be ok then.
please refer to: https://docs.docker.com/v1.8/articles/networking/