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);
}
}
§Features
The features of this crate add methods to the type Euui.
§With the feature random
- Euui::random
- Euui::random_from_first
- Euui::random_from_second
- Euui::random_from_third
- Euui::random_from_fourth
- Euui::regenerate_first
- Euui::regenerate_second
- Euui::regenerate_third
- Euui::regenerate_fourth
§With the feature uuid
- Euui::from_uuids
- Euui::with_uuid_part
- Euui::with_first
- Euui::with_second
- Euui::with_third
- Euui::with_fourth
- Euui::from_be_bytes
- Euui::uuid
§With the feature random_uuid
Structs§
- Euui
- Extended Universal Unique Identifier