bcrypt

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bcrypt contains password hashing and checking logic for stored passwords.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PasswordHandler

type PasswordHandler struct {
	// contains filtered or unexported fields
}

PasswordHandler can hash and check passwords

func NewPasswordHandler

func NewPasswordHandler() PasswordHandler

NewPasswordHandler creates a password handler with the default cost

func (PasswordHandler) Hash

func (ph PasswordHandler) Hash(password string) ([]byte, error)

Hash computes the password hash from the supplied password

func (PasswordHandler) IsCorrect

func (PasswordHandler) IsCorrect(hashedPassword []byte, password string) (bool, error)

IsCorrect determines if the hashed password matches the supplied password

Jump to

Keyboard shortcuts

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