salted

package
v0.0.0-...-555b434 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 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 Wrap

func Wrap(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