Skip to content

GrottoPress/pawn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.