argon2

package
v0.0.0-...-dc61bab Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Memory      uint32 `mapstructure:"memory"`
	Iterations  uint32 `mapstructure:"iterations"`
	Parallelism uint8  `mapstructure:"parallelism"`
	SaltLength  uint32 `mapstructure:"saltLength"`
	KeyLength   uint32 `mapstructure:"keyLength"`
}

type Hasher

type Hasher struct {
	// contains filtered or unexported fields
}

func NewHasherService

func NewHasherService(options ...Option) *Hasher

func (*Hasher) HashPassword

func (h *Hasher) HashPassword(password string) (string, error)

func (*Hasher) VerifyPassword

func (h *Hasher) VerifyPassword(password, hash string) bool

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Hasher.

func Preset

func Preset(options ...Option) Option

Preset turns a list of Option instances into an Option

func SetConfig

func SetConfig(cfg Config) Option

func SetIterations

func SetIterations(iterations uint32) Option

func SetKeyLength

func SetKeyLength(keyLength uint32) Option

func SetMemory

func SetMemory(memory uint32) Option

func SetParallelism

func SetParallelism(parallelism uint8) Option

func SetSaltLength

func SetSaltLength(saltLength uint32) Option

Jump to

Keyboard shortcuts

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