Poetry Pass
A memorable password generator using Chinese poetry and pinyin.
使用中国诗词和拼音生成易记密码的工具。
Features
- 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
Installation
Usage
use ;
// Default generation (full pinyin)
let password = generate;
// Example: "yingwu-guilaojianghubian-6694"
// Chinese original
let password = generate_chinese;
// Example: "鹦鹉-归老江湖边-5678"
// Initials only
let password = new.initials.generate;
// Example: "yw-gljhb-9012"
// Dual mode: front full pinyin, back initials
let password = new.front_full_back_init.generate;
// Example: "huaduo-hlzdc-1234" (花朵-红楼梦里的春天 -> huaduo-hlzdc)
// Dual mode: front initials, back full pinyin
let password = new.front_init_back_full.generate;
// Example: "hd-honglouzichuntiande-5678" (花朵-红楼梦里的春天 -> hd-honglouzichuntiande)
// Custom configuration
let password = new
.poetry_only
.separator
.no_number
.random_capitalize
.generate;
// Example: "yingWu_guiLaojianghubIan"
// Generate with source for memorization
let = new.generate_with_source;
println!;
println!;
// Specify source combinations
let password = new.words_poetry.generate;
// Example: "huaduo-yuelangxingxi-1234" (word-poem)
API
Generator Methods
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
Convenience Functions
generate()- Quick generation with defaultsgenerate_chinese()- Quick Chinese generation
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.