crypto

package
v0.0.0-...-e4064bc Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Cost is the cost used to hash passwords.
	Cost = 10
)

Variables

View Source
var (
	// ErrInvalidCredentials is returned when the credentials provided are invalid.
	ErrInvalidCredentials = errors.New("invalid credentials")
)

Functions

func CheckPassword

func CheckPassword(password, hash string) error

CheckPassword checks if a password matches a hash with bcrypt.

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes a password with bcrypt and the default cost of 10.

Types

This section is empty.

Jump to

Keyboard shortcuts

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