Crate checkpwn_lib

Source
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
Password is a wrapper type for a password that is checked at HIBP. It contains an opaque Debug impl, to avoid the SHA1 hash of the password to leak.

Enums§

CheckpwnError
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), bool indicating whether the account is breached or not. Err() is returned if an error occurred during the check.
check_password
Check password. Returns Ok(bool), bool indicating whether the password is breached or not. Err() is returned if an error occurred during the check.