Documentation
¶
Overview ¶
Package argon2id provides a simple interface for hashing and verifying passwords using the Argon2id algorithm. It offers a default configuration that can be customized as needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("argon2id: invalid hash format") ErrIncompatibleVersion = errors.New("argon2id: incompatible version of argon2") )
Predefined errors.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Memory uint32 // memory cost in kibibytes
Iterations uint32 // number of iterations
Parallelism uint8 // degree of parallelism (number of threads)
SaltLength uint32 // length of the random salt in bytes
KeyLength uint32 // length of the generated key in bytes
}
Config holds the parameters for the Argon2id algorithm. Users can use DefaultConfig() for recommended defaults. !Important note: Changing the value of the Parallelism parameter changes the hash output.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with recommended settings.
func (*Config) ComparePasswordAndHash ¶
ComparePasswordAndHash verifies whether the provided password matches the encoded hash. It returns true if they match.
Click to show internal directories.
Click to hide internal directories.