argon2

package
v1.0.5012 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHashWithPassword

func CompareHashWithPassword(hash, password string) (bool, error)

Compare Hash With Password

func GenerateSaltedHash

func GenerateSaltedHash(random io.Reader, password string) (string, error)

Generate Salted Hash

func GenerateSaltedHashWithType

func GenerateSaltedHashWithType(random io.Reader, password string, typ Argon2Type) (string, error)

Generate Salted Hash with type

func GenerateSaltedHashWithTypeAndOpts added in v1.0.5009

func GenerateSaltedHashWithTypeAndOpts(random io.Reader, password string, typ Argon2Type, opt Opts) (string, error)

Generate Salted Hash with type and opts

Types

type Argon2Type added in v1.0.5009

type Argon2Type uint

Argon2 Type enum

const (
	Argon2d Argon2Type = iota
	Argon2i
	Argon2id
	Argon2
)

func (Argon2Type) String added in v1.0.5009

func (typ Argon2Type) String() string

type Opts added in v1.0.5009

type Opts struct {
	SaltLen int
	Time    uint32
	Memory  uint32
	Threads uint8
	KeyLen  uint32
}

Argon2 options

Jump to

Keyboard shortcuts

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