Documentation ¶
Index ¶
- Variables
- func Compare(ctx context.Context, password []byte, hash []byte) error
- func CompareArgon2id(_ context.Context, password []byte, hash []byte) error
- func CompareBcrypt(_ context.Context, password []byte, hash []byte) error
- func IsArgon2idHash(hash []byte) bool
- func IsBcryptHash(hash []byte) bool
- type Argon2
- type Argon2Configuration
- type Bcrypt
- type BcryptConfiguration
- type HashProvider
- type Hasher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("the encoded hash is not in the correct format") ErrIncompatibleVersion = errors.New("incompatible version of argon2") ErrMismatchedHashAndPassword = errors.New("passwords do not match") )
View Source
var ErrUnknownHashAlgorithm = errors.New("unknown hash algorithm")
Functions ¶
func IsArgon2idHash ¶
func IsBcryptHash ¶
Types ¶
type Argon2 ¶
type Argon2 struct {
// contains filtered or unexported fields
}
func NewHasherArgon2 ¶
func NewHasherArgon2(c Argon2Configuration) *Argon2
type Argon2Configuration ¶
type Bcrypt ¶
type Bcrypt struct {
// contains filtered or unexported fields
}
func NewHasherBcrypt ¶
func NewHasherBcrypt(c BcryptConfiguration) *Bcrypt
type BcryptConfiguration ¶
type HashProvider ¶
type HashProvider interface {
Hasher() Hasher
}
Click to show internal directories.
Click to hide internal directories.