| Crates.io | passcore |
| lib.rs | passcore |
| version | 0.2.0 |
| created_at | 2026-01-12 23:50:54.039001+00 |
| updated_at | 2026-01-13 23:53:47.222058+00 |
| description | Passcore is a lightweight Rust library that scores password strength. |
| homepage | |
| repository | https://github.com/Papaya-Voldemort/passcore |
| max_upload_size | |
| id | 2039066 |
| size | 900,878 |
Passcore is a Rust library for scoring password strength using a transparent, multi-factor methodology. It provides a simple API to evaluate passwords and returns a score out of 1000, with detailed breakdowns for length, character variety, uniqueness, and penalties for common patterns.
Add Passcore to your Cargo.toml:
[dependencies]
passcore = "0.2.0"
Import and use the scoring functions:
use passcore::score;
let password = "MyS3cureP@ssw0rd!";
let score = score(password);
println!("Your password's score is {}", score);
use passcore::grade_password;
let password = "MyS3cureP@ssw0rd!";
let grade = grade_password(password);
println!("Your password's grade is: {}", grade);
use passcore::review_password;
let password = "weak";
let feedback = review_password(password);
println!("Feedback: {}", feedback);
Length: up to 400 points
Character Variety: up to 200 points
Uniqueness: up to 200 points
Penalties: up to 200 points (deducted for common passwords or patterns)
This release includes significant performance optimizations, reducing scoring time by 79.7%:
| Benchmark | Before | After | Improvement |
|---|---|---|---|
| Average Passcore time | 0.304455 ms | 0.061869 ms | 79.7% faster |
| Average zxcvbn time | 0.083165 ms | 0.076520 ms | 8.0% faster |
| Average password_strength time | 0.235982 ms | 0.221022 ms | 6.3% faster |
Benchmarks measured on 1000 randomly generated passwords (8-24 characters) using comparative testing against zxcvbn and password_strength libraries. In addition I tested twice so I thought to give you the small change of the other two libraries even though it fluctuates.
score(password: &str) -> u16Scores a password on a scale of 0-1000 based on length, variety, uniqueness, and common pattern penalties.
grade_password(password: &str) -> &strReturns a letter grade (F to A+) based on the password score.
review_password(password: &str) -> &strProvides actionable feedback on which aspect of the password needs improvement (length, variety, uniqueness, or common patterns).
Contributions are welcome! Please open issues or pull requests for improvements, bug fixes, or new scoring techniques.
This project is licensed under the MIT License.