| Crates.io | fl_uid |
| lib.rs | fl_uid |
| version | 0.1.3 |
| created_at | 2025-07-15 06:02:08.994003+00 |
| updated_at | 2025-09-23 06:22:58.271503+00 |
| description | Human readable UIDs |
| homepage | |
| repository | https://github.com/tascord/fluid |
| max_upload_size | |
| id | 1752632 |
| size | 4,709,828 |
use fl_uid::Fluid;
fn main() {
// Generate a new Fluid ID
let id = Fluid::new();
// Convert it to its human-readable string representation
let id_string = id.to_string();
println!("Generated Fluid ID: {}", id_string);
// Example output: "quick-brown-fox-jumps"
}
Fluid uses u128 as its internal random seed, providing a vast space of possible inputs. With the dictionary sizes:
ADJ: 1,075ADV: 1,524VRB: 874 N: 1,156For a total of 1,655,246,575,200 (over 1.6 trillion) unique combinations.
Practical Uniqueness: For most applications, generating a few million or even billion IDs, the probability of a random clash is extremely, vanishingly small.
Theoretical Clashes: The underlying u128 has far more states (2^128) than total word combinations. The to_string() implementation uses modulo arithmetic to map parts of the u128 to dictionary indices. This means that theoretically, different u128 values can produce the same string, but the immense number of combinations makes such collisions rare in practice unless you approach the limit of the combination space.