Created
August 23, 2018 14:27
-
-
Save matbesancon/287e8d19d63ea2a14fc6459372753fe1 to your computer and use it in GitHub Desktop.
Rust UUID minimal example to test result consistency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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