A lightweight Rust library for generating fun, random names in the format adjective-adjective-animal
.
Goofy Animals generates names like:
healthy-frivolous-dove
glorious-meager-polar-bear
thankful-elastic-clownfish
Perfect for:
- Container & machine names
- Test fixtures
- Temporary resources
- Development environments
- Anywhere you need a friendly, memorable identifier
- No-std compatible - Core functionality works without the standard library
- Lightweight - Uses compile-time string parsing for small binary size
- Fast - Efficient name generation with minimal overhead
- Configurable - Optional features for different use cases
- Deterministic - Support for seeded RNG for repeatable results
Add this to your Cargo.toml
:
[dependencies]
goofy-animals = "0.0.3"
use goofy_animals::generate_name;
use rand::SeedableRng;
use rand_chacha::ChaCha20Rng;
fn main() {
// Use a random seed
let mut rng = ChaCha20Rng::from_entropy();
// Generate a random name
let name = generate_name(&mut rng);
println!("{}", name); // e.g., "vigilant-troubled-firefly"
}
use goofy_animals::generate_name;
use rand::SeedableRng;
use rand_chacha::ChaCha20Rng;
fn main() {
// Use a fixed seed for deterministic output
let mut rng = ChaCha20Rng::seed_from_u64(0x1337);
let name = generate_name(&mut rng);
assert_eq!(name, "healthy-frivolous-dove");
}
If you want the individual name components:
use rand::SeedableRng;
use rand_chacha::ChaCha20Rng;
use goofy_animals::generate_name_parts;
fn main() {
let mut rng = ChaCha20Rng::from_entropy();
let (adj1, adj2, animal) = generate_name_parts(&mut rng);
println!("First adjective: {}", adj1);
println!("Second adjective: {}", adj2);
println!("Animal: {}", animal);
}
alloc
(default): Enables thegenerate_name
function that returns aString
std
: Used only for testingtracing
: Adds tracing instrumentation for debuggingexamples
: Enables building the example binarygoofy-animal
With the examples
feature enabled, you can build and run the simple CLI tool:
# Build with examples feature
cargo build --features=examples
# Run the binary
./target/debug/goofy-animal
# Output: handsome-modest-porcupine
Or you can install the CLI tool via cargo install
:
cargo install --features=examples goofy-animals
This project uses a Nix flake for development environment setup. If you have Nix installed:
# Enter the development shell
nix develop
Or with direnv:
direnv allow
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
The library includes:
- 355 animal names
- 1300 adjectives
All words are in English.