pwdhash

package
v0.0.0-...-b7e086b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) []byte

Create a random salt, and return fully baked hash, of length hashLenV1

func HashPasswordBase64

func HashPasswordBase64(password string) string

Return base64 encoding of HashPassword

func HashSessionToken

func HashSessionToken(value string) []byte

Hash the session token to safeguard against timing attacks (eg in the DB's BTree lookup) The caller gets the plaintext value, and that is the ONLY place where the plaintext lives.

func HashSessionTokenBase64

func HashSessionTokenBase64(value string) string

Return the base64 encoding of the hash of the session token

func VerifyHash

func VerifyHash(password string, hash []byte) bool

Returns true if a plaintext password matches a stored hash

func VerifyHashBase64

func VerifyHashBase64(password string, hashb64 string) bool

Returns true if a plaintext password matches a stored hash, in base64

Types

This section is empty.

Jump to

Keyboard shortcuts

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