hash

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hashedPassword, password string) error

ComparePassword compares a hashed password with a plain text password

func DummyCompare added in v1.2.7

func DummyCompare()

DummyCompare performs a throwaway bcrypt comparison. Call it on the user-not-found login path so an attacker cannot distinguish a missing account from a wrong password by response timing (user enumeration, CWE-204).

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes a plain text password using bcrypt

func HashToken

func HashToken(token string) string

HashToken hashes a token using SHA-256 for storage

Types

This section is empty.

Jump to

Keyboard shortcuts

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