Skip to content

Instantly share code, notes, and snippets.

@matbesancon
Created August 23, 2018 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matbesancon/287e8d19d63ea2a14fc6459372753fe1 to your computer and use it in GitHub Desktop.
Save matbesancon/287e8d19d63ea2a14fc6459372753fe1 to your computer and use it in GitHub Desktop.
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