bcrypts

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRounds      = 31
	MinRounds      = 4
	DefaultRounds  = 12
	SaltLen        = 16
	BlowfishRounds = 16
)

Variables

View Source
var (
	InvalidRounds = errors.New("bcrypt: Invalid rounds parameter")
	InvalidSalt   = errors.New("bcrypt: Invalid salt supplied")
)

Functions

func Hash

func Hash(password string, salt ...string) (ps string, err error)

func HashBytes

func HashBytes(password []byte, salt ...[]byte) (hash []byte, err error)

func Match

func Match(password, hash string) bool

func MatchBytes

func MatchBytes(password []byte, hash []byte) bool

func Password

func Password(password string) string

func PasswordCompare

func PasswordCompare(password, hash string) bool

func Salt

func Salt(rounds ...int) (string, error)

Salt generation

func SaltBytes

func SaltBytes(rounds ...int) (salt []byte, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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