sha256

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMismatchedHashAndPassword the error returned from CompareHashAndPassword when a password and hash do
	// not match.
	ErrMismatchedHashAndPassword = errors.New("hashedPassword is not the hash of the given password")
	// ErrBadAlgorithm the error returned from newFromHash when a hash not include necessary prefix
	ErrBadAlgorithm = errors.New("bad algorithm")
)

Functions

func CompareHashAndPassword

func CompareHashAndPassword(hashedPassword, password []byte, saltSize int) error

func ComparePasswords

func ComparePasswords(hashedPwd, plainPwd string) error

func GenerateFromPassword

func GenerateFromPassword(password []byte, saltSize int) ([]byte, error)

GenerateFromPassword returns the sha1 hash of the password at the given salt.

func HashAndSalt

func HashAndSalt(pwd string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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