A memorable password generator using Chinese poetry and pinyin.
使用中国诗词和拼音生成易记密码的工具。
- Multiple modes: Full pinyin, initials, or original Chinese
- Dual mode: Different transformations for different parts
- Source specification: Choose specific combinations (word-poem, poem-word, etc.)
- Configurable: Custom separators, optional numbers
- Poetry & words: Mix classical poetry with common words
cargo add poetry-pass
use poetry_pass::{Generator, generate, generate_chinese};
// Default generation (full pinyin)
let password = generate();
// Example: "yingwu-guilaojianghubian-6694"
// Chinese original
let password = generate_chinese();
// Example: "鹦鹉-归老江湖边-5678"
// Initials only
let password = Generator::new().initials().generate();
// Example: "yw-gljhb-9012"
// Dual mode: front full pinyin, back initials
let password = Generator::new().front_full_back_init().generate();
// Example: "huaduo-hlzdc-1234" (花朵-红楼梦里的春天 -> huaduo-hlzdc)
// Dual mode: front initials, back full pinyin
let password = Generator::new().front_init_back_full().generate();
// Example: "hd-honglouzichuntiande-5678" (花朵-红楼梦里的春天 -> hd-honglouzichuntiande)
// Custom configuration
let password = Generator::new()
.poetry_only()
.separator("_")
.no_number()
.random_capitalize()
.generate();
// Example: "yingWu_guiLaojianghubIan"
// Generate with source for memorization
let (password, source) = Generator::new().generate_with_source();
println!("Password: {}", password);
println!("Source: {}", source);
// Specify source combinations
let password = Generator::new().words_poetry().generate();
// Example: "huaduo-yuelangxingxi-1234" (word-poem)
new()
- Create with default settingsinitials()
- Use pinyin initialsfull_pinyin()
- Use full pinyin (default)chinese()
- Keep original Chinesepoetry_only()
- Use only poetrywords_only()
- Use only wordswords_poetry()
- Front: words, back: poetrypoetry_words()
- Front: poetry, back: wordswords_words()
- Front: words, back: wordspoetry_poetry()
- Front: poetry, back: poetrydual_mode(front, back)
- Set different transformation modes for front and back partsfront_full_back_init()
- Front part uses full pinyin, back part uses initialsfront_init_back_full()
- Front part uses initials, back part uses full pinyinseparator(sep)
- Set custom separatorno_number()
- Don't add random numberrandom_capitalize()
- Enable random capitalizationgenerate()
- Generate passwordgenerate_with_source()
- Generate with source textgenerate_multiple(count)
- Generate multiple passwords
generate()
- Quick generation with defaultsgenerate_chinese()
- Quick Chinese generation
Licensed under either of Apache License, Version 2.0 or MIT license at your option.