Documentation ¶
Overview ¶
Package hash implements the password hashing algorithms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncorrectPassword = errors.New("password is not correct")
ErrIncorrectPassword is returned when the provided password is incorrect.
Functions ¶
This section is empty.
Types ¶
type Argon2Hasher ¶
type Argon2Hasher struct {
// contains filtered or unexported fields
}
Argon2Hasher uses Argon2 to hash passwords with random salt.
func NewArgon2Hasher ¶
func NewArgon2Hasher(opts ...Option) Argon2Hasher
NewArgon2Hasher creates a new Argon2Hasher.
func (Argon2Hasher) Check ¶
func (ah Argon2Hasher) Check(plain, hash string) error
Check checks if the provided password is correct or not.
type Option ¶
type Option func(*Argon2Hasher)
Option is a function that can be used to customize the Argon2Hasher.
Click to show internal directories.
Click to hide internal directories.