password

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package password hashes the passwords of the account with argon2id, and makes the session tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(password string) string

Hash gives the password's argon2id hash with its random salt, in the PHC format ($argon2id$v=19$m=…).

func Token

func Token() string

Token gives a new session token: 32 random bytes, for the client only.

func TokenHash

func TokenHash(token string) string

TokenHash is what the base keeps of a token: enough to recognize it, useless to log in.

func Verify

func Verify(password, hash string) bool

Verify tells whether password gives hash, in constant time; false for a hash it cannot read.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL