Lines Matching full:uuid
1 use crate::Uuid;
3 impl Uuid { implementation
4 /// Creates a UUID using a name from a namespace, based on the SHA-1 hash.
18 /// Generating a SHA1 DNS UUID for `rust-lang.org`:
21 /// # use uuid::{Uuid, Version};
22 /// let uuid = Uuid::new_v5(&Uuid::NAMESPACE_DNS, b"rust-lang.org");
24 /// assert_eq!(Some(Version::Sha1), uuid.get_version());
31 /// [`NAMESPACE_DNS`]: struct.Uuid.html#associatedconst.NAMESPACE_DNS
32 /// [`NAMESPACE_OID`]: struct.Uuid.html#associatedconst.NAMESPACE_OID
33 /// [`NAMESPACE_URL`]: struct.Uuid.html#associatedconst.NAMESPACE_URL
34 /// [`NAMESPACE_X500`]: struct.Uuid.html#associatedconst.NAMESPACE_X500
35 pub fn new_v5(namespace: &Uuid, name: &[u8]) -> Uuid { in new_v5() argument
53 static FIXTURE: &'static [(&'static Uuid, &'static str, &'static str)] = &[ variable
55 &Uuid::NAMESPACE_DNS,
60 &Uuid::NAMESPACE_DNS,
65 &Uuid::NAMESPACE_DNS,
70 &Uuid::NAMESPACE_DNS,
75 &Uuid::NAMESPACE_URL,
80 &Uuid::NAMESPACE_URL,
85 &Uuid::NAMESPACE_URL,
90 &Uuid::NAMESPACE_URL,
95 &Uuid::NAMESPACE_OID,
100 &Uuid::NAMESPACE_OID,
105 &Uuid::NAMESPACE_OID,
110 &Uuid::NAMESPACE_OID,
115 &Uuid::NAMESPACE_X500,
120 &Uuid::NAMESPACE_X500,
125 &Uuid::NAMESPACE_X500,
130 &Uuid::NAMESPACE_X500,
146 let uuid = Uuid::new_v5(&Uuid::NAMESPACE_DNS, "rust-lang.org".as_bytes()); in test_get_version() localVariable
148 assert_eq!(uuid.get_version(), Some(Version::Sha1)); in test_get_version()
149 assert_eq!(uuid.get_version_num(), 5); in test_get_version()
163 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_hyphenated() localVariable
165 assert_eq!(uuid.hyphenated().to_string(), *expected) in test_hyphenated()
180 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_new() localVariable
182 assert_eq!(uuid.get_version(), Some(Version::Sha1)); in test_new()
183 assert_eq!(uuid.get_variant(), Variant::RFC4122); in test_new()
184 assert_eq!(Ok(uuid), u.parse()); in test_new()