salted

package
v0.0.0-...-2f21ade Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSaltLength = 8

Variables

This section is empty.

Functions

func EnsureSalt

func EnsureSalt(salt []byte) ([]byte, error)

func GenerateSalt

func GenerateSalt(n int) ([]byte, error)

func Split

func Split(passwordHash []byte) (password []byte, salt []byte, err error)

Types

type Hasher

type Hasher struct {
	Hasher hasher.Hasher
	Salt   []byte
}

func Salted

func Salted(h hasher.Hasher, salt []byte) *Hasher

func (*Hasher) Compare

func (sh *Hasher) Compare(passwordHash, password []byte) error

func (*Hasher) CompareSalted

func (sh *Hasher) CompareSalted(passwordHash, password, salt []byte) error

func (*Hasher) Hash

func (sh *Hasher) Hash(data []byte) (hash []byte, err error)

func (*Hasher) HashWithSalt

func (sh *Hasher) HashWithSalt(password, salt []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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