passwords

package
v0.0.0-...-7609c90 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxTimeout default max timeout in ms
	DefaultMaxTimeout = 500 * time.Millisecond

	// DefaultMaxMemory default max memory in MB
	DefaultMaxMemory = 64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

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

Options ...

func NewOptions

func NewOptions(maxTimeout time.Duration, maxMemory int) *Options

NewOptions ...

type Passwords

type Passwords interface {
	CreatePassword(password string) (string, error)
	CheckPassword(hash, password string) error
}

Passwords is an interface for creating and verifying secure passwords An implementation must implement all methods and it is up to the impl which underlying crypto to use for hasing cleartext passwrods.

func NewScryptPasswords

func NewScryptPasswords(options *Options) Passwords

NewScryptPasswords ...

type ScryptPasswords

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

ScryptPasswords ...

func (*ScryptPasswords) CheckPassword

func (sp *ScryptPasswords) CheckPassword(hash, password string) error

CheckPassword ...

func (*ScryptPasswords) CreatePassword

func (sp *ScryptPasswords) CreatePassword(password string) (string, error)

CreatePassword ...

Jump to

Keyboard shortcuts

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