argon2

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

DefaultConfig returns the default configuration for Argon2

func NewArgon2Crypto

func NewArgon2Crypto(config *types.Config) (interfaces.Cryptographic, error)

NewArgon2Crypto creates a new Argon2 crypto instance

Types

type Argon2

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

Argon2 implements the Argon2 hashing algorithm

func (*Argon2) Hash

func (c *Argon2) Hash(password string) (string, error)

Hash implements the hash method

func (*Argon2) HashWithSalt

func (c *Argon2) HashWithSalt(password, salt string) (string, error)

HashWithSalt implements the hash with salt method

func (*Argon2) Verify

func (c *Argon2) Verify(hashed, password string) error

Verify implements the verify method

type ConfigValidator

type ConfigValidator struct{}

ConfigValidator implements the config validator for Argon2

func (*ConfigValidator) Validate

func (v *ConfigValidator) Validate(config *types.Config) error

Validate validates the Argon2 configuration

type Params

type Params struct {
	TimeCost   uint32
	MemoryCost uint32
	Threads    uint8
	KeyLength  uint32
}

Params represents parameters for Argon2 algorithm

func (*Params) String

func (p *Params) String() string

String returns the string representation of parameters

Jump to

Keyboard shortcuts

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