hasher

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlgorithmHMACSHA512 pbkdf2HashAlgorithm = iota
	AlgorithmHMACSHA256
	AlgorithmHMACSHA1
)

Variables

View Source
var (
	ErrorWrongSaltLength   = errors.New("hasher: Wrong salt size in provided hash")
	ErrorWrongSubkeyLength = errors.New("hasher: Wrong subkey length in provided hash")
	ErrorWrongAlgorithm    = errors.New("hasher: Password hashed with wrong algorithm")
)

Functions

This section is empty.

Types

type Hasher

type Hasher interface {
	Verify(hash, password string) (result PasswordVerificationResult, err error)
	Hash(password string) (hash string, err error)
}

func New added in v0.0.2

func New() Hasher

func NewArgon2id

func NewArgon2id() Hasher

func NewPbkdf2

func NewPbkdf2() Hasher

func NewPbkdf2FromAlgo added in v0.0.2

func NewPbkdf2FromAlgo(algorithm pbkdf2HashAlgorithm) Hasher

type PasswordVerificationResult

type PasswordVerificationResult uint8
const (
	PasswordVerificationFailed PasswordVerificationResult = iota
	PasswordVerificationSuccess
	PasswordVerificationNeedsRehash
)

func (PasswordVerificationResult) String

Jump to

Keyboard shortcuts

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