Skip to content

Instantly share code, notes, and snippets.

@matbesancon matbesancon/main.rs
Created Aug 23, 2018

Embed
What would you like to do?
Rust UUID minimal example to test result consistency
extern crate uuid;
use uuid::Uuid;
fn main() {
let refs = vec![&uuid::NAMESPACE_DNS, &uuid::NAMESPACE_OID, &uuid::NAMESPACE_URL, &uuid::NAMESPACE_X500];
let tags = vec!["NAMESPACE_DNS", "NAMESPACE_OID", "NAMESPACE_URL", "NAMESPACE_X500"];
let pairs = refs
.iter()
.zip(tags.iter())
.map(|(u,t)|
(t, u, Uuid::new_v5(u, "julia"))
);
for (t, u1,u2) in pairs {
println!("{0}: {1} - {2}", t, u1, u2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.