Latest 1.0.1
Homepage https://github.com/vhosune/HaveIBeenPwned
License MIT
Platforms ios 8.0
Authors

License
Cocoapods Compatible
Carthage Compatible

Swift library for haveibeenpwned.com

Quick hands on

  • Check if a password has already been pwned in a breach
import HaveIBeenPwned

let session = HaveIBeenPwned()

try? session.search(password: "password") { result in
    if let pwned = try? result() {
        print("password pwned (pwned) times.")
    }
}
  • Check if a site has been breached
let session = HaveIBeenPwned()

_ = try? session.breach(name: "yahoo", completion: { result in
    do {
        let pwned = try result()
        print("breach (pwned)")
    }
    catch HaveIBeenPwned.ErrorCode.notFound {
        print("not breached")
    }
    catch {
    }

})
  • Check if a user account appears in a breach
let session = HaveIBeenPwned()

_ = try? session.breached(account: "[email protected]", completion: { result in
    do {
        let pwned = try result()
        print("breached (pwned)")
    }
    catch HaveIBeenPwned.ErrorCode.notFound {
        print("not breached")
    }
    catch {
    }

})

Requirements

  • iOS 8.0+
  • Xcode 10.0+
  • Swift 4.2+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

Podfile:

    pod 'HaveIBeenPwned'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

Cartfile:

github "vhosune/HaveIBeenPwned"

Latest podspec

{
    "name": "HaveIBeenPwned",
    "version": "1.0.1",
    "summary": "Swift library for haveibeenpwned.com",
    "description": "Swift Library to haveibeenpwned.com API based on API v2.n- You can check if a password has already been pwned in a breach.n- You can query for known breaches",
    "homepage": "https://github.com/vhosune/HaveIBeenPwned",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vincent HO-SUNE": "[email protected]"
    },
    "source": {
        "git": "https://github.com/vhosune/HaveIBeenPwned.git",
        "tag": "1.0.1"
    },
    "ios": {
        "source_files": "HaveIBeenPwned/**/*.{h,swift}"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This