Coder Social home page Coder Social logo

haveibeenpwned's Introduction

haveibeenpwned

A PHP Library built for ';--have i been pwned?

Actively Maintained Latest Stable Version Total Downloads Scrutinizer Code Quality Build Status Codacy Badge License

Table of contents

Requirements

  1. This uses only API v2.
  2. PHP 7 or higher.

Installation

Open your composer.json file and add the following to the require key:

"ridvanbaluyos/haveibeenpwned": "v0.1"

After adding the key, run composer update from the command line to install the package

composer install

or

composer update

Usage

<?php
error_reporting(E_ALL);
// namespace and autoloaders
use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;
require_once __DIR__ . '/vendor/autoload.php';

$breachedAccount = new BreachedAccount();
$result = $breachedAccount->setAccount('[email protected]')->get();

Breached Account

<?php
use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;

$breachedAccount = new BreachedAccount();
$result = $breachedAccount->setAccount('[email protected]')
        ->setIncludeUnverified()
        ->setDomain('tumblr.com')
        ->get();

Breached Sites

<?php
use \Ridvanbaluyos\Pwned\Breaches as Breaches;

$breachedSites = new Breaches();
$result = $breachedSites->setDomain('adobe.com')->get();

Data Classes

<?php
use \Ridvanbaluyos\Pwned\DataClasses as DataClasses;

$dataClasses = new DataClasses();
$result = $dataClasses->get();

Pastes Account

<?php
use \Ridvanbaluyos\Pwned\PasteAccount as PasteAccount;

$pasteAccount = new PasteAccount();
$result = $pasteAccount->setAccount('[email protected]')->get();

Pwned Passwords

Note: Please be careful when using this. Do not send any password you actively use to a third-party service - even this one!

<?php
use Ridvanbaluyos\Pwned\PwnedPasswords as PwnedPasswords;

$pwnedPasswords = new PwnedPasswords();
$result = $pwnedPasswords->setPassword('password123')->get();

References

haveibeenpwned's People

Contributors

ridvanbaluyos avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

tw1920

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.