Registry / crypto / password-hash

password-hash

JSON →
library0.6.1rscratesunverified

Traits for password hashing algorithms with PHC string format support.

# Cargo.toml [dependencies] password-hash = "0.6.1"
INSTALL
IMPORT
SIG · PASSWORD-HASH
P
password-hash
cryptorustv0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PasswordHash
use password_hash::PasswordHash;

Hashes a password using Argon2 and prints the PHC string.

use password_hash::{PasswordHash, PasswordHasher, SaltString}; use password_hash::argon2::Argon2; fn main() -> Result<(), Box<dyn std::error::Error>> { let salt = SaltString::generate(&mut rand::thread_rng()); let hash = Argon2::default().hash_password(b"password", &salt)?; println!("{}", hash); Ok(()) }
Debug
Known issues
gotchaRequires a specific algorithm crate (e.g., argon2) to be used.
fix
Add `argon2` crate to dependencies.
affects: *
Upgrade
Version history
0.6.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
password-hash — cargo add password-hash · libregistry