Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrInvalidHash in returned by ComparePasswordAndHash if the provided // hash isn't in the expected format. ErrInvalidHash = utils.Error("argon2id: hash is not in the correct format") // ErrIncompatibleVersion is returned by ComparePasswordAndHash if the // provided hash was created using a different version of Argon2. ErrIncompatibleVersion = utils.Error("argon2id: incompatible version of argon2") )
Variables ¶
This section is empty.
Functions ¶
func Argon2IdCreateHash ¶
func Argon2IdCreateHash(password string, c Argon2Config) (string, error)
func Argon2IdNeedsRehash ¶
func Argon2IdNeedsRehash(c *Argon2Config) bool
Types ¶
type Argon2Config ¶
type Argon2Config struct { Memory uint32 `json:"memory"` Iterations uint32 `json:"iterations"` Parallelism uint8 `json:"parallelism"` SaltLength uint32 `json:"saltLength"` KeyLength uint32 `json:"keyLength"` }
Argon2Config blueprint-style config struct
func Argon2IdComparePassword ¶
func Argon2IdComparePassword(password, hash string) (bool, *Argon2Config, error)
Argon2IdComparePassword Compares password and hash, and returns the hash configto enable re-hashing if necessary
func Argon2IdDecodeHash ¶
func Argon2IdDecodeHash(hash string) (*Argon2Config, []byte, []byte, error)
func NewArgon2IdConfig ¶
func NewArgon2IdConfig() Argon2Config
Click to show internal directories.
Click to hide internal directories.