password

package
v0.0.0-...-0026d00 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 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 BCryptHasher

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

BCryptHasher is a implementation of Hasher that uses the BCrypt strong hashing function.

func (*BCryptHasher) Hash

func (e *BCryptHasher) Hash(password string) (string, error)

Hash the raw password.

func (*BCryptHasher) Verify

func (e *BCryptHasher) Verify(hashed string, password string) bool

Verify the hashed and clear password is equals.

type Hasher

type Hasher interface {
	Hash(password string) (string, error)
	Verify(hashed string, password string) bool
}

Hasher interface for encoding passwords.

func NewBCryptHasher

func NewBCryptHasher(cost int) Hasher

NewBCryptHasher constructor.

Jump to

Keyboard shortcuts

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