Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultArgon2Iterations = 3
DefaultArgon2Iterations value
View Source
const DefaultArgon2KeyLength = 32
DefaultArgon2KeyLength value
View Source
const DefaultArgon2Memory = 64 * 1024
DefaultArgon2Memory value
View Source
const DefaultArgon2Parallelism = 2
DefaultArgon2Parallelism value
View Source
const DefaultArgon2SaltLength = 16
DefaultArgon2SaltLength value
Variables ¶
This section is empty.
Functions ¶
func ComparePasswordAndHash ¶
ComparePasswordAndHash verifies a password is same as password used to generate the given hash
Types ¶
type Argon2Config ¶
type Argon2Config struct { Memory uint32 Iterations uint32 Parallelism uint8 SaltLength uint32 KeyLength uint32 }
Argon2Config values for configuring the Argon2 hashing algorithm
type ContextIn ¶
type ContextIn struct {
Argon2Config Argon2Config
}
ContextIn describes dependecies needed by this package
type ContextOut ¶
type ContextOut struct {
PasswordHasher PasswordHasher
}
ContextOut describes dependencies exported by this package
func Bootstrap ¶
func Bootstrap(in *ContextIn) *ContextOut
Bootstrap initializes this module with ContextIn and exports resulting ContextOut
type PasswordHasher ¶
type PasswordHasher interface {
GeneratePasswordHash(password string) (encodedHash string, err error)
}
PasswordHasher generates hashes for cleartext passwords
Click to show internal directories.
Click to hide internal directories.