pwdhash

package
v0.0.0-...-5dcd16a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Password-Hash Interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasswordMismatch            = errors.New("Password Mismatch")
	ErrInvalidPasswordHash         = errors.New("Invalid Password Hash")
	ErrUnknownPasswordHashFunction = errors.New("Unknown Password Hash Function")
)

Functions

func Register

func Register(name string, ph PasswordHash)

Types

type PasswordHash

type PasswordHash interface {
	CompareHashAndPassword(hashedPassword, password []byte) error
	GenerateFromPassword(password []byte, cost int) ([]byte, error)
}

func DefaultPasswordHash

func DefaultPasswordHash() PasswordHash

func GetPasswordHash

func GetPasswordHash(name string) (PasswordHash, error)

Jump to

Keyboard shortcuts

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