Help us shape the future of Go! Take the 2026 Go Developer Survey

pwn

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyPassword = errors.New("password cannot be empty")

ErrEmptyPassword is an empty password error

Functions

func WithContext

func WithContext(ctx context.Context) func(pwnClient *Client)

WithContext will set the context.Context of a Client

func WithHTTP

func WithHTTP(httpClient *http.Client) func(pwnClient *Client)

WithHTTP will set the http.Client of a Client

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a HaveIBeenPwned client

func New

func New(options ...ClientOption) *Client

New returns a new HaveIBeenPwned Client

func (*Client) CheckPassword

func (c *Client) CheckPassword(pw string, padding bool) (int64, error)

CheckPassword returns the number of times a password has been compromised Adding padding will make requests more secure, however is also slower because artificial responses will be added to the response For more information, see https://www.troyhunt.com/enhancing-pwned-passwords-privacy-with-padding/

type ClientOption

type ClientOption func(*Client)

ClientOption is a way to modify a new Client

Source Files

  • pwn.go

Jump to

Keyboard shortcuts

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