hash

package
v0.0.0-...-ebfcf3b Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid      = errors.New("invalid hash format")
	ErrMismatched   = errors.New("password doesn't match")
	ErrIncompatible = errors.New("incompatible version")
)

Functions

This section is empty.

Types

type Argon2idHasher

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

func (*Argon2idHasher) Compare

func (h *Argon2idHasher) Compare(password string, hash string) error

func (*Argon2idHasher) Hash

func (h *Argon2idHasher) Hash(password string) (string, error)

type Hasher

type Hasher interface {
	Hash(password string) (string, error)
	Compare(password string, hash string) error
}

func NewArgon2idHasher

func NewArgon2idHasher(pepper string) Hasher

Jump to

Keyboard shortcuts

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