password

package
v0.0.0-...-1a5deed Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BcryptService

type BcryptService struct {
}

BcryptService is responsible for hashing/comparing passwords using the bcrypt algorithm

func (BcryptService) CheckPasswordHash

func (service BcryptService) CheckPasswordHash(password string, hash string) bool

CheckPasswordHash verifies if the password matches the hashed value

func (BcryptService) HashPassword

func (service BcryptService) HashPassword(password string) (string, error)

HashPassword hashes a password

type Service

type Service interface {
	HashPassword(password string) (string, error)
	CheckPasswordHash(password string, hash string) bool
}

Service is responsible for hashing and comparing hashed passwords

func NewBcryptService

func NewBcryptService() Service

NewBcryptService creates a new instance of the bcrypt service

Jump to

Keyboard shortcuts

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