mike-jg/pwned-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mike-jg/pwned-api

Composer 安装命令:

composer require mike-jg/pwned-api

包简介

PwnedApi is a PHP library to work with the API at https://haveibeenpwned.com/API/v2/

README 文档

README

This is meant as a simple way to interface with the service at https://haveibeenpwned.com/API/v2/

Build Status

Installation

$ composer require mike-jg/pwned-api

Basic Usage

The preferred way to interact with the API is to use the Client::searchByRange method, as this protects the value of the source password being searched for. See https://haveibeenpwned.com/API/v2/#SearchingPwnedPasswordsByRange

<?php
use PwnedApi\Client;

$client = new Client();

$password = sha1("P@ssw0rd");
$rangeResult = $client->searchByRange($password);

// Boolean: was this password found?
echo $rangeResult->wasFound();
// How many times this password was found in the database
echo $rangeResult->getCount();

Alternatively you can also search by a specific password to see if it was found. See https://haveibeenpwned.com/API/v2/#SearchingPwnedPasswordsByPassword

<?php
use PwnedApi\Client;
   
$client = new Client();

$password = sha1("P@ssw0rd");
$rangeResult = $client->searchByPasswordHash($password);

// Boolean: was this password found?
echo $rangeResult->wasFound();
// How many times this password was found in the database
echo $rangeResult->getCount();

Overriding the HTTP client

To specify a different HTTP client to use, e.g. if you need to inject proxy details.

<?php
use PwnedApi\Client;

$client = new Client();
$client->setHttpClient(new GuzzleHttp\Client());

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-02-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固