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
49 static FIXTURE: &'static [(&'static Uuid, &'static str, &'static str)] = &[ variable
51 &Uuid::NAMESPACE_DNS,
56 &Uuid::NAMESPACE_DNS,
61 &Uuid::NAMESPACE_DNS,
66 &Uuid::NAMESPACE_DNS,
71 &Uuid::NAMESPACE_URL,
76 &Uuid::NAMESPACE_URL,
81 &Uuid::NAMESPACE_URL,
86 &Uuid::NAMESPACE_URL,
91 &Uuid::NAMESPACE_OID,
96 &Uuid::NAMESPACE_OID,
101 &Uuid::NAMESPACE_OID,
106 &Uuid::NAMESPACE_OID,
111 &Uuid::NAMESPACE_X500,
116 &Uuid::NAMESPACE_X500,
121 &Uuid::NAMESPACE_X500,
126 &Uuid::NAMESPACE_X500,
135 let uuid = Uuid::new_v5(&Uuid::NAMESPACE_DNS, "rust-lang.org".as_bytes()); in test_get_version() localVariable
137 assert_eq!(uuid.get_version(), Some(Version::Sha1)); in test_get_version()
138 assert_eq!(uuid.get_version_num(), 5); in test_get_version()
145 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_hyphenated() localVariable
147 assert_eq!(uuid.hyphenated().to_string(), *expected) in test_hyphenated()
155 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_new() localVariable
157 assert_eq!(uuid.get_version(), Some(Version::Sha1)); in test_new()
158 assert_eq!(uuid.get_variant(), Variant::RFC4122); in test_new()
159 assert_eq!(Ok(uuid), u.parse()); in test_new()