fl_uid

Crates.iofl_uid
lib.rsfl_uid
version0.1.3
created_at2025-07-15 06:02:08.994003+00
updated_at2025-09-23 06:22:58.271503+00
descriptionHuman readable UIDs
homepage
repositoryhttps://github.com/tascord/fluid
max_upload_size
id1752632
size4,709,828
flora ~ 🏳️‍⚧️ ❤ 🦀 (tascord)

documentation

README

Icon

Fluid

Human Readable Uids

GitHub top language Crates.io Version docs.rs

Features

  • Human Readable Uids: Generate unique identifiers that easy discern.
  • High Uniqueness: Leverages a large dictionary to provide trillions of possible combinations

Usage

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"
}

Uniqueness and Clash Probability

Fluid uses u128 as its internal random seed, providing a vast space of possible inputs. With the dictionary sizes:

  • ADJ: 1,075
  • ADV: 1,524
  • VRB: 874
  • N: 1,156

For 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.

Commit count: 10

cargo fmt