argon

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemoryKey      = "security.argon2.memory"
	IterationKey   = "security.argon2.iterations"
	ParallelismKey = "security.argon2.parallelism"
	SaltLengthKey  = "security.argon2.saltLength"
	KeyLengthKey   = "security.argon2.keyLength"

	DefaultMemory      = 64 * 1024
	DefaultIterations  = 3
	DefaultParallelism = 2
	DefaultSaltLength  = 16
	DefaultKeyLength   = 32
)

Variables

View Source
var (
	ErrInvalidHash    = errors.New("argon2: ValidatePassword: invalid password hash")
	ErrInvalidVersion = errors.New("argon2: ValidatePassword: incorrect version of argon2")
	ErrWrongPassword  = errors.New("argon2: ValidatePassword: wrong password")
)

Functions

func GenerateFromPassword

func GenerateFromPassword(password string) (string, error)

func NeedsMigration

func NeedsMigration(encodedHash string) bool

func ValidatePassword

func ValidatePassword(password, encodedHash string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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