Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidArgonVersion = errors.New("argon2 version is incompatible with hash version")
View Source
var ErrInvalidHash = errors.New("password hash is invalid")
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
type Hasher struct {
Params Params
}
func NewWithParams ¶
NewWithParams returns new hasher with custom parameters
func (Hasher) ComparePasswordAndHash ¶
ComparePasswordAndHash compares provided password with hashed password. It'll return whether they match or not.
func (Hasher) Hash ¶
Hash generates hash for provided password with additional informations. These informations contains version of argon2, memory, iterations, parallelism and salt. The final format is the following: "hasher&v=version&m=memory,t=iterations,p=parallelism&salt&passwordHash".
func (Hasher) MustComparePasswordAndHash ¶
MustComparePasswordAndHash is same as ComparePasswordAndHash(), but panics if there's an error
Click to show internal directories.
Click to hide internal directories.