passcheck 0.1.1

A flexible rule-base password validation library
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 8 items with examples
  • Size
  • Source code size: 5.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.42 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ALIasgharBalochi/passcheck
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ALIasgharBalochi

🔐 passcheck

passcheck is a flexible and lightweight password validation crate for Rust.
It allows you to define custom rules for checking password strength and structure — use only what you need!


🚀 Features

  • ✅ Rule-based validation system
  • ✅ Add only the checks you want: length, number, special char, etc.
  • ✅ Lightweight and dependency-free
  • ✅ Easy to use and extend

📦 Installation

Add this to your Cargo.toml:

[dependencies]

passcheck = "0.1.0"  

example

use passcheck::PasswordChecker;

fn main() {
    let checker = PasswordChecker::new()
        .min_length(8)
        .require_number()
        .require_special_char();

    match checker.validate("Ali@123") {
        Ok(_) => println!("✅ Strong password!"),
        Err(errors) => {
            println!("❌ Invalid password:");
            for err in errors {
                println!("  - {}", err);
            }
        }
    }
}

🔧 Available Rules

min_length(n) → Requires password to be at least n characters

require_upper_lower() → Requires at least one uppercase and one lowercase letter

require_number() → Requires at least one digit

require_special_char() → Requires at least one special character


📄 License MIT

💻 Author Made with ❤ + ☕ by Ali