| Crates.io | poetry-pass |
| lib.rs | poetry-pass |
| version | 0.1.2 |
| created_at | 2025-08-07 20:30:32.583205+00 |
| updated_at | 2025-08-08 17:43:53.606842+00 |
| description | A memorable password generator using Chinese poetry and pinyin |
| homepage | |
| repository | https://github.com/leavelet/poetry-pass-rs |
| max_upload_size | |
| id | 1785777 |
| size | 101,230 |
A memorable password generator using Chinese poetry and pinyin.
使用中国诗词和拼音生成易记密码的工具。
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 passwordsgenerate() - Quick generation with defaults
generate_chinese() - Quick Chinese generation
Licensed under either of Apache License, Version 2.0 or MIT license at your option.