Documentation
¶
Overview ¶
Package password hashes and verifies user passwords with argon2id and mints opaque session tokens. The encoded hash embeds the algorithm parameters and salt so parameters can be raised later without invalidating existing hashes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidHash = errors.New("password: invalid encoded hash")
ErrInvalidHash is returned when an encoded hash cannot be parsed.
Functions ¶
func GenerateToken ¶
GenerateToken returns a 256-bit URL-safe random token (the raw session secret handed to the client; only its HashToken digest is stored).
func Hash ¶
Hash returns an argon2id encoded hash of plaintext: $argon2id$v=19$m=19456,t=2,p=1$<b64salt>$<b64hash>.
Types ¶
This section is empty.