argon2

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 9 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) Type added in v0.2.14

func (c *Argon2) Type() string

func (*Argon2) Verify

func (c *Argon2) Verify(parts *types.HashParts, password string) error

Verify implements the verify method

type ConfigValidator

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

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 DefaultParams added in v0.2.14

func DefaultParams() Params

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