Expand description
§Usage:
use checkpwn_lib::{Password, check_password, check_account, CheckpwnError};
let password = Password::new("qwerty")?;
check_password(&password);
check_account("your_account", "your_api_key");
Structs§
- Password
Passwordis a wrapper type for a password that is checked at HIBP. It contains an opaqueDebugimpl, to avoid the SHA1 hash of the password to leak.
Enums§
- Checkpwn
Error - Errors related to checking passwords and accounts.
Constants§
- CHECKPWN_
USER_ AGENT - The checkpwn UserAgent sent to HIBP.
Functions§
- check_
account - Check account, on both account and paste databases, using a given API key.
Before sending a request, the thread sleeps for 1600 millis. HIBP limits at 1500.
Returns Ok(bool),
boolindicating whether the account is breached or not. Err() is returned if an error occurred during the check. - check_
password - Check password.
Returns Ok(bool),
boolindicating whether the password is breached or not. Err() is returned if an error occurred during the check.