| Crates.io | hightower-naming |
| lib.rs | hightower-naming |
| version | 0.1.4 |
| created_at | 2025-10-02 00:09:42.605934+00 |
| updated_at | 2025-10-10 19:03:16.785696+00 |
| description | Generate random names with epic adjectives and nouns |
| homepage | |
| repository | https://github.com/chrishayen/hightower-naming |
| max_upload_size | |
| id | 1863671 |
| size | 19,463 |
Generate random hightower-style names with adjectives and nouns.
Add this to your Cargo.toml:
[dependencies]
hightower-naming = "0.1.4"
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
}
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
}
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
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)