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
//! A lightweight alternative to Apache's htpasswd tool.
//!
//! This library provides functionality to create, read, and modify htpasswd files
//! with support for bcrypt, SHA-256, SHA-512, and APR1-MD5 password hashing algorithms.
//!
//! # Example
//!
//! ```no_run
//! use htauth::{Htpasswd, HashAlgorithm};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create or open an htpasswd file
//! let mut htpasswd = Htpasswd::open(".htpasswd")?;
//!
//! // Add a new user
//! htpasswd.add_user("alice", "password123", HashAlgorithm::Bcrypt)?;
//!
//! // Verify a user's password
//! if htpasswd.verify_user("alice", "password123")? {
//! println!("Password correct!");
//! }
//!
//! // List all users
//! for user in htpasswd.list_users() {
//! println!("{}", user);
//! }
//!
//! // Save changes
//! htpasswd.save()?;
//! # Ok(())
//! # }
//! ```
pub use Error as Apr1Md5Error;
pub use ;
pub use ;