lib

package
v0.0.0-...-c6e12e2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is in an invalid format")
	ErrIncompatibleVersion = errors.New("the encoded hash is using an incompatible version of Argon2")
)
View Source
var DefaultGenerateParams = &GenerateParams{
	SaltLength:  32,
	Iterations:  4,
	Memory:      64 * 1024,
	Parallelism: 1,
	KeyLength:   32,
}

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(password, encodedHash string) (bool, error)

func GenerateFromPassword

func GenerateFromPassword(password string, params *GenerateParams) (string, error)

func Random

func Random(size uint) ([]byte, error)

Types

type GenerateParams

type GenerateParams struct {
	SaltLength  uint
	Iterations  uint32
	Memory      uint32
	Parallelism uint8
	KeyLength   uint32
}

Jump to

Keyboard shortcuts

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