bcrypt

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinCost     int = 4
	MaxCost     int = 31
	DefaultCost int = 10
)

Variables

View Source
var ErrHashTooShort = errors.New("crypto/bcrypt: hashedSecret too short to be a bcrypted password")
View Source
var ErrMismatchedHashAndPassword = errors.New("crypto/bcrypt: hashedPassword is not the hash of the given password")

Functions

func CompareHashAndPassword

func CompareHashAndPassword(hashedPassword, password []byte) error

func Cost

func Cost(hashedPassword []byte) (int, error)

func GenerateFromPassword

func GenerateFromPassword(salt []byte, password []byte, cost int) ([]byte, error)

Types

type HashVersionTooNewError

type HashVersionTooNewError byte

func (HashVersionTooNewError) Error

func (hv HashVersionTooNewError) Error() string

type InvalidCostError

type InvalidCostError int

func (InvalidCostError) Error

func (ic InvalidCostError) Error() string

type InvalidHashPrefixError

type InvalidHashPrefixError byte

func (InvalidHashPrefixError) Error

func (ih InvalidHashPrefixError) Error() string

Jump to

Keyboard shortcuts

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