password

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchCrypt = errors.Newf(errors.Unknown, "no such unix password hashing method")
	Instances      = make(map[string]Crypt)
)

Functions

func GetSupportedFeatureFlags added in v0.2.0

func GetSupportedFeatureFlags() []string

func Validate

func Validate(password string, hash []byte) (bool, error)

Types

type Apr1

type Apr1 struct{}

func (*Apr1) Name added in v0.2.0

func (p *Apr1) Name() string

func (*Apr1) Validate

func (p *Apr1) Validate(password string, hash []byte) (bool, error)

type Crypt

type Crypt interface {
	Validate(password string, hash []byte) (bool, error)
	Name() string
}

type Md5

type Md5 struct{}

func (*Md5) Name added in v0.2.0

func (p *Md5) Name() string

func (*Md5) Validate

func (p *Md5) Validate(password string, hash []byte) (bool, error)

type Sha256

type Sha256 struct{}

func (*Sha256) Name added in v0.2.0

func (p *Sha256) Name() string

func (*Sha256) Validate

func (p *Sha256) Validate(password string, hash []byte) (bool, error)

type Sha512

type Sha512 struct{}

func (*Sha512) Name added in v0.2.0

func (p *Sha512) Name() string

func (*Sha512) Validate

func (p *Sha512) Validate(password string, hash []byte) (bool, error)

type Yescrypt

type Yescrypt struct{}

func (*Yescrypt) Name added in v0.2.0

func (p *Yescrypt) Name() string

func (*Yescrypt) Validate

func (p *Yescrypt) Validate(password string, hash []byte) (bool, error)

Jump to

Keyboard shortcuts

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