hash

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrHashesDoesNotMatch = "hashes do not match"
)

Variables

This section is empty.

Functions

func RandomSalt

func RandomSalt(size ...int) string

Types

type Argon2HashOpts

type Argon2HashOpts struct {
	Time    uint32
	Memory  uint32
	Threads uint8
	KeyLen  uint32
}

type HashFunction

type HashFunction interface {
	Hash(salt, text string) (string, error)
	Verify(salt, hashed, plain string) error
}

HashFunction interface for hashing and verifying hashes

func NewArgon2Hasher

func NewArgon2Hasher(opts Argon2HashOpts) HashFunction

func NewBryptHash

func NewBryptHash(cost ...int) HashFunction

Jump to

Keyboard shortcuts

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