Skip to content

fharding1/pwnedpass

Repository files navigation

PwnedPass

Godoc License: MIT CI: CircleCI

PwnedPass is a Go library for accessing the Pwned Password API. It currently only supports the V2 version of the API. It's got a dead simple API, tests, and benchmarks.

Usage

See godoc for usage and documentation.

CLI

You can visit releases to download a stable version of the CLI tool, or you can install from the latest source with:

go get github.com/fharding1/pwnedpass/cmd/pwnedpass

Usage

Using the CLI tool is fairly simple:

pwnedpass password
pwnedpass "a password with spaces"

Performance

Running on my computer, the benchmark results I get are:

BenchmarkCount-8              	    5000	    216640 ns/op
BenchmarkCountIntegration-8   	      50	  26431351 ns/op

The test with a mock local HTTP server takes about 231893 ns/op, while the integration tests against the actual API take 24331000 ns/op, meaning the only real limitation is the speed of the API and your network.