dump

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 12 Imported by: 0

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
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

func New(dumps ...string) (*Scanner, error)

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

func (s *Scanner) LookupBatch(ctx context.Context, in []string) []string

LookupBatch takes a slice SHA1 hashes and matches them against the provided dumps

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL