Documentation ¶
Overview ¶
Package dump implements an haveibeenpwned.com dump scanner. It is designed to operate on HIBP SHA-1 dumps which are ordered by hash. It will work with dumps ordered by prevalence, too. But processing those will take much, much longer.
Unfortunately these dumps need to be unpacked before use, since there is no 7z implementation for Go at the time of this writing.
Example ¶
{ //nolint:testableexamples ctx := context.Background() scanner, err := New("path/to/hibp-dump") if err != nil { panic(err) } matches := scanner.LookupBatch(ctx, []string{ "list", "of", "sha1", "hashes", }) fmt.Println(matches) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a HIBP dump scanner.
func New ¶
New creates a new scanner. Provide a list of filenames to HIBP SHA-1 dumps. Those should be ordered by hash or lookups will take forever.
func (*Scanner) LookupBatch ¶
LookupBatch takes a slice SHA1 hashes and matches them against the provided dumps.
Click to show internal directories.
Click to hide internal directories.