Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Euui - Extended Universal Unique Identifier
Description
Euui is a Rust library (no_std compatible) that provides a 512-bit (64 bytes) unique identifier, which is 4 times
larger than traditional UUIDs or GUIDs. This allows for enhanced uniqueness and adaptability in scenarios where more
significant identifiers are required.
The Euui type can be utilized for various applications, offering readable formats and flexible access to its
components (Uuid, u128, u64, u8), for unique identification in embedded or resource-constrained environments.
Key Features
-
Size: A single
Euuiconsists of 512 bits (64 bytes), making it exceptionally unique. -
Formatting:
- A raw hexadecimal string representation of 128 characters.
- A formatted string with 131 characters, including separators (
-) and line breaks (\n).
-
Components Access:
- Retrieve identifiers as 4×
u128, 8×u64, or 64×u8.
- Retrieve identifiers as 4×
-
Generation:
- Create a zero-initialized
Euuiusingdefault(). - Generate a random
Euuiusingrandom().
- Create a zero-initialized
Usage
Here are examples of how to use the Euui library:
Creation and Basic Operations
use Euui;
Accessing Parts of an Euui
You can retrieve specific components (u128, u64, or u8) of the Euui as needed:
// Access one of the u128 components
Advanced Initialization
You can initialize an Euui using custom GUIDs or bytes:
From GUIDs (u128 array)
From Bytes (u8 array)
API Overview
The main functionalities of the Euui type are:
Creation Methods
Euui::default() -> EuuiEuui::from_be_guids([u128; 4]) -> EuuiEuui::from_be_bytes([u8; 64]) -> Euui
Accessor Methods
u128(index: usize) -> Option<u128>Index must be in the range[0, 3].u64(index: usize) -> Option<u64>Index must be in the range[0, 7].u8(index: usize) -> Option<u8>Index must be in the range[0, 63].to_be_bytes() -> [u8; 64]Euuias an array of 64*u8.to_be_longs() -> [u64; 8]Euuias an array of 8*u64.to_be_guids() -> [u128; 4]Euuias an array of 4×u128.
Features
With the feature random
Euui::random() -> EuuiEuui::random_from_first(u128)
& (random_from_second,random_from_third,random_from_fourth)Euui::regenerate_first(&self)
& (regenerate_second,regenerate_third,regenerate_fourth).
With the feature uuid
Euui::with_uuid_part(Uuid, usize)
& (Euui::with_first(Uuid),Euui::with_second,Euui::with_third, **Euui::with_fourth).Euui::from_be_bytes([Uuid; 4])uuid(index: usize) -> Option<Uuid>Index must be in the range[0, 3].
With the feature random_uuid
Euui::random_uuids()Generates a newEuuiinstance with an array of randomUuid/v4values
Display Methods
to_string()Converts theEuuito a single hexadecimal string representation.format() -> StringFormats theEuuiinto a structured string, following the pattern: #1-#2 #3-#4.
Read the complete API documentation here.
Use Cases : Large-Scale Unique ID Generation
With 512 bits of entropy, Euui can be useful for applications where traditional 128-bit UUIDs are insufficient to
guarantee uniqueness:
- Distributed systems,
- Cryptographic key identifiers,
- Unique identifiers in high-throughput environments,
- Large enough to have UUID/GUID parts.
License
© 2024-2025 Sébastien GELDREICH
This project is licensed under the MIT License. See LICENSE for more details.