hash

package
v0.0.0-...-0bd2313 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash               = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion       = errors.New("incompatible version of argon2")
	ErrMismatchedHashAndPassword = errors.New("passwords do not match")
)

Functions

This section is empty.

Types

type Argon2

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

func NewHasherArgon2

func NewHasherArgon2(dx argon2Dependencies) *Argon2

func (*Argon2) Compare

func (h *Argon2) Compare(ctx context.Context, password []byte, hash []byte) error

func (*Argon2) Generate

func (h *Argon2) Generate(ctx context.Context, password []byte) ([]byte, error)

type Hasher

type Hasher interface {
	Compare(ctx context.Context, password []byte, hash []byte) error
	Generate(ctx context.Context, password []byte) ([]byte, error)
}

type Provider

type Provider interface {
	Hasher() Hasher
}

Jump to

Keyboard shortcuts

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