From 496cdc9af2dd153bc1bcb2004aea1354979cdfb9 Mon Sep 17 00:00:00 2001
From: realaravinth
+[![Documentation](https://img.shields.io/badge/docs-master-blue)](https://realaravinth.github.io/argon2-creds/argon2_creds/index.html)
![CI (Linux)](
diff --git a/src/lib.rs b/src/lib.rs
index 8d03aab..1606ab6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,25 +3,65 @@
//!
//! ## Example
//!
+//! 1. The easiest way to use this crate is with the default configuration. See `Default`
+//! implementation for the default configuration.
+//!
//! ```rust
//! use argon2_creds::Config;
//!
//! fn main() {
-//! let username = "iamBatman";
-//! let password = "ironmansucks";
-//! let email = "iambatman@wayne.org";
+//! let config = Config::default();
//!
-//! let config = Config::default();
-//! let hash = config.password(password).unwrap();
-//! config.email(Some("batman@we.net")).unwrap();
-//! let username = config.username("Realaravinth").unwrap();
-//! let hash = config.password(password).unwrap();
-//! assert_eq!(username, "realaravinth");
-//! assert!(Config::verify(&hash, password).unwrap(), "verify hahsing");
+//! let password = "ironmansucks";
+//! let hash = config.password(password).unwrap();
//!
+//! // email validation
+//! config.email(Some("batman@we.net")).unwrap();
+//!
+//! // process username
+//! let username = config.username("Realaravinth").unwrap(); // process username
+//!
+//! // generate hash
+//! let hash = config.password(password).unwrap();
+//!
+//! assert_eq!(username, "realaravinth");
+//! assert!(Config::verify(&hash, password).unwrap(), "verify hahsing");
//! }
//! ```
//!
+//! 2. To gain fine-grained control over how credentials are managed, consider using
+//! [ConfigBuilder]:
+//!
+//!```rust
+//! use argon2_creds::{ConfigBuilder, Config};
+//!
+//! fn main() {
+//! let config = ConfigBuilder::default()
+//! .salt_length(32)
+//! .username_case_mapped(false)
+//! .profanity(true)
+//! .blacklist(false)
+//! .argon2(argon2::Config::default())
+//! .build()
+//! .unwrap();
+//!
+//! let password = "ironmansucks";
+//! let hash = config.password(password).unwrap();
+//!
+//! // email validation
+//! config.email(Some("batman@we.net")).unwrap();
+//!
+//! // process username
+//! let username = config.username("Realaravinth").unwrap(); // process username
+//!
+//! // generate hash
+//! let hash = config.password(password).unwrap();
+//!
+//! assert_eq!(username, "realaravinth");
+//! assert!(Config::verify(&hash, password).unwrap(), "verify hahsing");
+//! }
+//!```
+//!
//! ## Documentation & Community Resources
//!
//! In addition to this API documentation, other resources are available:
@@ -32,9 +72,7 @@
//!
//! * [Config]: This struct is the entry point to `argon2_creds`
//!
-//! * [User]: This struct represents a fully processed credentials
-//!
-//! * [Error]: This module provides essential types for errors that can occour during
+//! * [CredsError]: This module provides essential types for errors that can occour during
//! credential processing
//!
//! ## Features
@@ -52,5 +90,5 @@ pub mod config;
pub mod errors;
mod filters;
-pub use crate::config::Config;
+pub use crate::config::{Config, ConfigBuilder};
pub use crate::errors::{CredsError, CredsResult};