hash

package
v0.0.0-...-ec63eb9 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EHashGenPasswordHash = status.Error(
	codes.Internal,
	"could not hash the password",
)

EHashGenPasswordHash is a GRPC error that is returned when the hash of a password could not be generated.

Functions

func VerifyPasswordHash

func VerifyPasswordHash(plainPassword string, expectedHash []byte, salt []byte) bool

verifyPasswordHash verifies the provided plain text password to verify if the provided plain text password generates a hash that will match the expected hash.

Types

type PasswordHashDetails

type PasswordHashDetails struct {
	Hash []byte
	Salt []byte
}

func GeneratePasswordHash

func GeneratePasswordHash(password string) (PasswordHashDetails, error)

generatePasswordHash hashes the provided password returning the hash generated and the random salt that was used for hashing the password.

Jump to

Keyboard shortcuts

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