Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("argon2id: invalid format") ErrIncompatibleVersion = errors.New("argon2id: version incompatible") )
Functions ¶
This section is empty.
Types ¶
type Argon2 ¶
type Argon2 interface {
Hash(password string) (string, error)
Compare(password, hash string) (match bool, err error)
}
func CreateArgon2 ¶
func CreateArgon2(random io.Reader, config Argon2Config) Argon2
Creates a new Argon2id password hasher using default parameters using user-defined parameters.
type Argon2Config ¶
type Argon2Config struct {
Memory uint32 `yaml:"memory" json:"memory" mapstructure:"memory"`
Iterations uint32 `yaml:"iterations" json:"iterations" mapstructure:"iterations"`
Parallelism uint8 `yaml:"parallelism" json:"parallelism" mapstructure:"parallelism"`
SaltLength uint32 `yaml:"saltLen" json:"saltLen" mapstructure:"saltLen"`
KeyLength uint32 `yaml:"keyLen" json:"keyLen" mapstructure:"keyLen"`
}
type Argon2Hasher ¶
type Argon2Hasher struct {
Argon2
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.