hightower-naming

Crates.iohightower-naming
lib.rshightower-naming
version0.1.4
created_at2025-10-02 00:09:42.605934+00
updated_at2025-10-10 19:03:16.785696+00
descriptionGenerate random names with epic adjectives and nouns
homepage
repositoryhttps://github.com/chrishayen/hightower-naming
max_upload_size
id1863671
size19,463
Chris Hayen (chrishayen)

documentation

README

hightower-naming

Generate random hightower-style names with adjectives and nouns.

Installation

Add this to your Cargo.toml:

[dependencies]
hightower-naming = "0.1.4"

Usage

Basic Usage

use hightower_naming::generate_random_name;

fn main() {
    // Generate name without random suffix
    let name = generate_random_name(None);
    println!("{}", name);
    // Example output: legendary-dragon

    // Generate name with 5 character random suffix
    let name = generate_random_name(Some(5));
    println!("{}", name);
    // Example output: legendary-dragon-79642

    // Generate name with custom suffix length
    let name = generate_random_name(Some(10));
    println!("{}", name);
    // Example output: legendary-dragon-3928574062
}

With Custom Prefix

use hightower_naming::generate_random_name_with_prefix;

fn main() {
    // Generate name with custom prefix
    let name = generate_random_name_with_prefix(Some("app"), None);
    println!("{}", name);
    // Example output: app-legendary-dragon

    // Generate name with custom prefix and random suffix
    let name = generate_random_name_with_prefix(Some("app"), Some(5));
    println!("{}", name);
    // Example output: app-legendary-dragon-79642
}

Name Format

Generated names follow the format:

  • Without prefix: {adjective}-{noun}[-{random}]

  • With prefix: {prefix}-{adjective}-{noun}[-{random}]

  • Prefix: Optional custom prefix (default: none)

  • Adjective: Random adjective (e.g., "alpha", "legendary", "unstoppable")

  • Noun: Random noun (e.g., "warrior", "titan", "phoenix")

  • Random suffix: Optional numeric string

Examples

Run examples with:

cargo run --example basic
cargo run --example with_random_suffix
cargo run --example custom_suffix_length
cargo run --example with_prefix

Example outputs:

  • legendary-dragon (no suffix, no prefix)
  • legendary-dragon-39285 (5 character suffix)
  • unstoppable-titan-1234567890 (10 character suffix)
  • app-supreme-phoenix (custom prefix, no suffix)
  • app-alpha-warrior-74629 (custom prefix with 5 character suffix)
Commit count: 0

cargo fmt