pawn

A low-level API client for Pwned Passwords

Pawn

Pawn is a low-level API client for Pwned Passwords.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      pawn:
        github: GrottoPress/pawn
    
  2. Run shards update

  3. Require Pawn in your app/library:

    # ...
    require "pawn"
    # ...
    

Usage

  1. Check if a password appears in any breach:

    Pawn.pwned?("password") # <= true
    
  2. Find how many times a password appears in breaches:

    Pawn.count("password") # <= 3861493
    

Either method accepts an optional padding, a Bool argument that sends a Add-Padding header along with the request to Pwned Passwords API.

Development

Run tests with crystal spec.

Contributing

  1. Fork it
  2. Switch to the master branch: git checkout master
  3. Create your feature branch: git checkout -b my-new-feature
  4. Make your changes, updating changelog and documentation as appropriate.
  5. Commit your changes: git commit
  6. Push to the branch: git push origin my-new-feature
  7. Submit a new Pull Request against the GrottoPress:master branch.
Repository

pawn

Owner
Statistic
  • 6
  • 0
  • 0
  • 1
  • 2
  • 4 months ago
  • August 26, 2021
License

MIT License

Links
Synced at

Thu, 26 Dec 2024 19:31:20 GMT

Languages