| Crates.io | sarhash-core |
| lib.rs | sarhash-core |
| version | 0.1.0 |
| created_at | 2025-12-12 17:39:28.379732+00 |
| updated_at | 2025-12-12 17:39:28.379732+00 |
| description | A modular library for password hashing (Argon2) and strength verification (zxcvbn). |
| homepage | |
| repository | https://github.com/saroj/sarhash-core |
| max_upload_size | |
| id | 1981904 |
| size | 29,703 |
sarhash-core is a modular Rust library designed for secure password operations. It combines Argon2 hashing with zxcvbn strength estimation.
argon2 crate.zxcvbn.Add this to your Cargo.toml:
[dependencies]
sarhash-core = "0.1.0"
use sarhash_core::{hash_password, verify_password, check_strength};
fn main() {
let password = "correct horse battery staple";
// 1. Check Strength
let strength = check_strength(password);
println!("Score: {}/4", strength.score);
// 2. Hash Password
let hash = hash_password(password).expect("hashing failed");
println!("Hash: {}", hash);
// 3. Verify Password
let is_valid = verify_password(password, &hash).expect("verification failed");
assert!(is_valid);
}
MIT