Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCryptHasher ¶
type BCryptHasher struct {
// contains filtered or unexported fields
}
BCryptHasher implements Hasher interface. Hashes passwords using bcrypt algorithm.
func NewBCryptHasher ¶
func NewBCryptHasher(opts ...Option) *BCryptHasher
NewBCryptHasher returns a pointer to a new instance of BCryptHasher type.
func (*BCryptHasher) CheckPassword ¶
func (h *BCryptHasher) CheckPassword(hash, pass string) error
func (*BCryptHasher) HashPassword ¶
func (h *BCryptHasher) HashPassword(pass string) (string, error)
type Hasher ¶
type Hasher interface {
// HashPassword takes password and return a hasher from it.
HashPassword(pass string) (string, error)
// CheckPassword takes password and perform comparison with
// stored hashed password.
CheckPassword(hash, pass string) error
}
Hasher holds logic of hashing and checking the password.
Click to show internal directories.
Click to hide internal directories.