argon2

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(encoded, password string) (bool, error)

CheckPasswordHash compares a plain-text password with a stored hash (JSON encoded).

func HashPassword

func HashPassword(password string, p *Params) (string, error)

HashPassword generates a secure Argon2ID hash for the given password and parameters.

Types

type Hash

type Hash struct {
	Data   []byte  `json:"data"`
	Salt   []byte  `json:"salt"`
	Params *Params `json:"params"`
}

type Params

type Params struct {
	Memory      uint32 `json:"m"`
	Iterations  uint32 `json:"i"`
	Parallelism uint8  `json:"p"`
	SaltLength  uint32 `json:"s"`
	KeyLength   uint32 `json:"k"`
}

Jump to

Keyboard shortcuts

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