Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCost = Cost{
Time: 3,
Memory: 128 * 1024,
Threads: 2,
KeyLen: 32,
SaltLen: 32,
}
DefaultCost for argon2id
View Source
var ErrInvalidHash = errors.New("argon2id/parse: Hash is not argon2id")
ErrInvalidHash returned when hash is not argon2id
View Source
var ErrMismatchedHashAndPassword = errors.New("utils/password/compare.go: Mismatched hashedPassword and password")
ErrMismatchedHashAndPassword returned when no account is found
Functions ¶
This section is empty.
Types ¶
type Cost ¶
type Cost struct { Time uint32 `json:"time"` Memory uint32 `json:"memory"` Threads uint8 `json:"threads"` KeyLen uint32 `json:"keyLen"` SaltLen int32 `json:"saltLen"` }
Cost for argon2id
type Password ¶
Password Argon2ID password struct
func (*Password) NeedRehash ¶
NeedRehash checks hash values to
func (*Password) ToString ¶
ToString returns a formated argon2id string $argon2id$v=19$$m={memory},t={time},p={threads}${salt}${key}
func (*Password) ToStringNoKey ¶
ToStringNoKey returns a formated argon2id string without key $argon2id$v=19$$m={memory},t={time},p={threads}${salt}${key}
Click to show internal directories.
Click to hide internal directories.