argon2go

package module
v0.0.0-...-434f103 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid is returned when a hash is not syntactically valid.
	ErrInvalid = errors.New("argon2: the hash is not valid")
	// ErrMismatch is returned when hash verification fails.
	ErrMismatch = errors.New("argon2: password did not match the hash")
)

Functions

func Hash

func Hash(password []byte, opts *Options) (string, error)

Hash applies argon2id hashing using the provided options on the password.

func Verify

func Verify(password []byte, hash string) error

Verify first parses the hash and checks if it is a valid argon2id hash. Then it applies the same hashing as in Hash and checks if the password is correct.

Types

type Options

type Options struct {
	Time       uint32
	Memory     uint32
	Threads    uint8
	HashLength uint32
	SaltLength uint32
}

Options are the variables used to hash a password.

Jump to

Keyboard shortcuts

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