Documentation
¶
Overview ¶
Package passlib provides password hashing using Argon2id algorithm. Argon2id is the recommended password hashing algorithm by OWASP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMemoryCost uint32 = 65536 // 64 MB DefaultTimeCost uint32 = 4 DefaultThreads uint8 = 1 )
Default parameters for Argon2id hashing. These values follow OWASP recommendations.
View Source
var ( ErrInvalidHash = errors.New("passlib: unable to parse hash value") ErrIncompatibleVariant = errors.New("passlib: hash variant is not compatible") ErrIncompatibleVersion = errors.New("passlib: hash version is not supported") ErrNotMatch = errors.New("passlib: password does not match hash") )
Errors returned by passlib functions.
Functions ¶
func Hash ¶
Hash generates an Argon2id hash of the password using default parameters. Returns a PHC-formatted string that includes the algorithm, version, parameters, salt, and hash.
func NeedsRehash ¶ added in v1.0.0
NeedsRehash checks if the hash was created with outdated parameters and should be rehashed with current default parameters.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.