Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("passwordtool: invalid hash password") ErrMismatched = errors.New("passwordtool: hashed and password mismatched") )
Errors
Functions ¶
Types ¶
type Argon2id ¶
Argon2id strategy
type Bcrypt ¶
type Bcrypt struct {
Cost int
}
Bcrypt strategy
type BcryptHash ¶
BcryptHash strategy
func (BcryptHash) Compare ¶
func (hc BcryptHash) Compare(hashedPassword string, password string) error
Compare compares hashed with password
func (BcryptHash) Hash ¶
func (hc BcryptHash) Hash(password string) (string, error)
Hash hashes password
func (BcryptHash) String ¶
func (hc BcryptHash) String() string
type HashComparer ¶
type HashComparer interface { fmt.Stringer Hash(password string) (string, error) Compare(hashedPassword string, password string) error }
HashComparer interface
Click to show internal directories.
Click to hide internal directories.