Expand description
This crate provides the Euui struct.
This type represents a unique identifier which is 4 times bigger than UUIDs and GUIDs.
So, an EUUI is 512 bits or 64 bytes. It can be read as 4xu128, 8xu64 or 64xu8.
A raw hexadecimal string representing an EUUI is 128 characters wide.
A formatted hexadecimal string representing an EUUI is 131 characters wide (two “-” and one “\n”).
You can create :
- a zero Euui with Euui::default,
Then, use :
- Euui::format to display it as 4 u128s or
.to_string()to get the whole hexadecimal string, - or, Euui::u128 or Euui::to_be_guids to reach for individual u128s,
- or, Euui::u64 to reach for individual u64s,
- or, Euui::u8 or Euui::to_be_bytes to reach for individual u8s.
§Example
use euui::Euui;
// Generate a zero-initialized Euui
let zero_euui = Euui::default(); // or Euui::zero()
println!("Zero Euui: {}", zero_euui);
// Generate a random Euui
#[cfg(feature = "random")]
fn test_random() {
let random_euui = Euui::random();
println!("Random Euui: {}", random_euui);
// Format a Euui
let formatted = random_euui.format();
println!("Formatted Euui:\n{}", formatted);
// Access specific parts of the Euui
if let Some(first_u128) = random_euui.u128(0) {
println!("First u128 of random Euui: {:032x}", first_u128);
}
}Structs§
- Euui
- Extended Universal Unique Identifier