laszlof/php-hibp
Composer 安装命令:
composer require laszlof/php-hibp
包简介
A PHP library for communicating with the HaveIBeenPwned.com API
README 文档
README
laszlof/php-hibp is an SDK which allows PHP developers to easily communicate with the API provided by HaveIBeenPwned.Com.
Requirements
- PHP 7.0+
How to install
composer require laszlof/php-hibp
Usage
Get a list of breaches for a specific acccount (username/email)
use Hibp\Hibp; $account = 'you@yourdomain.com'; $breaches = Hibp::getBreaches($account);
Get a single breach by name
use Hibp\Hibp; $name = 'Adobe'; $breach = Hibp::getBreach($account);
Get a list of sites that have been breached (optionally filtered by domain)
use Hibp\Hibp; $breaches = Hibp::getBreachedSites(); $domain = 'adobe.com'; $breaches = Hibp::getBreachedSites($domain);
Get a list of the types of dataclasses
use Hibp\Hibp; $dataClasses = Hibp::getDataClasses();
Get a list of pastes for a specific acccount (username/email)
use Hibp\Hibp; $account = 'you@yourdomain.com'; $breaches = Hibp::getPastes($account);
Check if a password has been compromised.
use Hibp\Hibp; $password = 'password123'; $isCompromised = Hibp::checkPassword($password); // Optionally check with a password that IS a hash itself. $password_is_a_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'; $isCompromised = Hibp::checkPassword($password_is_a_hash, true);
Links
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-06