1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! # PassForge
//!
//! `passforge` is a robust and flexible password generation library that allows users to create
//! secure passwords and passphrases with various customization options. It also provides
//! functionality for evaluating password strength and allows for easy extension through the
//! `Generator` and `StrengthEvaluator`.
//!
//! ## Features
//!
//! - Generate passwords with customizable length and character sets
//! - Create passphrases using a word list
//! - Evaluate password strength using the zxcvbn algorithm
//! - Command-line interface for easy use
//! - Extendible through `Generator` and `StrengthEvaluator` traits.
//!
//! ## Getting Started
//!
//! To use PassForge in your project, add the following to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! passforge = "0.1.0"
//! ```
//!
//! Then, you can use the library in your Rust code as shown in the examples below.
//!
//! ## Examples
//!
//! Generating a Password
//!
//! ```
//! use passforge::{PasswordConfig, PasswordGenerator, Generator, Length};
//!
//! let config = PasswordConfig::new(Length::Single(16), true, true, true);
//! let password = PasswordGenerator::generate(&config).expect("Failed to generate password");
//! println!("Generated password: {}", password);
//! ```
//!
//! Creating a Passphrase
//!
//! ```
//! use passforge::{PassphraseConfig, PassphraseGenerator, Generator, WordList};
//!
//! let config = PassphraseConfig::new(4, "-".to_string(), WordList::Default);
//! let passphrase = PassphraseGenerator::generate(&config).expect("Failed to generate passphrase");
//! println!("Generated passphrase: {}", passphrase);
//! ```
//!
//! Evaluating Password Strength
//!
//! ```
//! use passforge::{ZxcvbnAnalysis, StrengthEvaluator};
//!
//! let password = "example_password".into();
//! let strength = ZxcvbnAnalysis::evaluate(&password).expect("Failed to evaluate password");
//! println!("Password strength: {}", strength);
//! ```
// Re-export main structs and traits for easier access
pub use ;
pub use PassForgeError;
pub use ;
pub use ;
/// Configuration structures for password and passphrase generation,
/// Custom error types used throughout the crate to provide
/// detailed information about failure conditions.
/// Core generation functionality for passwords and passphrases,
/// implementing the Generator trait for different types of generators.
/// Password strength evaluation functionality using the zxcvbn algorithm,
/// providing detailed analysis of password security. Extendible by implementing the
/// `StrengthEvaluator trait`