passwd

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHasher = NewBcryptHasher(bcrypt.DefaultCost)
)

Functions

func Compare

func Compare(hashed, source []byte) error

func CompareString

func CompareString(hashed, source string) error

func Hash

func Hash(bs []byte) ([]byte, error)

func HashString

func HashString(str string) (string, error)

Types

type BcryptHasher

type BcryptHasher struct {
	Cost int
}

func NewBcryptHasher

func NewBcryptHasher(cost int) *BcryptHasher

func (*BcryptHasher) Compare

func (bh *BcryptHasher) Compare(hashed, source []byte) error

func (*BcryptHasher) CompareString

func (bh *BcryptHasher) CompareString(hashed, source string) error

func (*BcryptHasher) Hash

func (bh *BcryptHasher) Hash(bs []byte) ([]byte, error)

func (*BcryptHasher) HashString

func (bh *BcryptHasher) HashString(str string) (string, error)

Jump to

Keyboard shortcuts

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