Documentation
¶
Overview ¶
Package argon2 contains the Argon2id hasher implementation.
Index ¶
Constants ¶
View Source
const ( MinMemory = 32 * 1024 MinIterations = 2 MinParallelism = 1 MaxMemory = 1024 * 1024 MaxIterations = 100 MaxParallelism = 32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argon2idHasher ¶
type Argon2idHasher struct {
Memory uint32
Iterations uint32
Parallelism uint8
SaltLength uint32
KeyLength uint32
}
Argon2idHasher wraps parameterized Argon2id hashing operations.
func Default ¶
func Default() *Argon2idHasher
Default returns an Argon2idHasher configured with library defaults.
func (*Argon2idHasher) Hash ¶
func (a *Argon2idHasher) Hash(password []byte) (string, error)
Hash derives an Argon2id key, zeroizes inputs, and returns the PHC string.
func (*Argon2idHasher) ID ¶
func (a *Argon2idHasher) ID() string
ID reports the PHC algorithm identifier.
func (*Argon2idHasher) NeedsRehash ¶
func (a *Argon2idHasher) NeedsRehash(encoded string) (bool, error)
NeedsRehash reports whether the encoded parameters diverge from the current configuration.
type PolicyParams ¶ added in v0.2.0
PolicyParams captures the Argon2 tuning knobs for a policy preset.
func ParamsForPolicy ¶ added in v0.2.0
func ParamsForPolicy(p int) (PolicyParams, error)
ParamsForPolicy returns the Argon2 parameters associated with the policy id.
Click to show internal directories.
Click to hide internal directories.