gocrypto

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRandomBytes              = errors.New("can not generate random bytes")
	ErrHashMismatch             = errors.New("hash mismatch")
	ErrFailedToParseData        = errors.New("failed to parse data")
	ErrInvalidEncodedHash       = errors.New("invalid encoded hash")
	ErrInvalidAlgorithmVersion  = errors.New("invalid algorithm version")
	ErrUnsupportedHashAlgorithm = errors.New("unsupported hash algorithm")
)

Functions

func Compare

func Compare(password, encodedHash string) error

Compare Check if the password and hash mataches. If not returns an error

func Hash

func Hash(password string, parms HashParsms) (string, error)

Hash Creats a new hash based using the given params

Types

type HashParsms

type HashParsms struct {
	Memory      uint32
	Iterations  uint32
	Parallelism uint8
	SaltLength  uint32
	KeyLentgh   uint32
}

Jump to

Keyboard shortcuts

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