credentials

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHashFormat         = errors.New("invalid hash format")
	ErrArgon2VersionIncompatible = errors.New("argon2 version incompatible")
)
View Source
var DefaultArgon2id = Argon2idHash{
	// contains filtered or unexported fields
}

Functions

func Compare

func Compare(password, encodedHash string) (bool, error)

Compare compares a password with its hash.

Types

type Argon2idHash

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

func NewArgon2idHash

func NewArgon2idHash(time, memory uint32, threads uint8, keyLen, saltLen uint32) *Argon2idHash

func NewDefaultArgon2idHash

func NewDefaultArgon2idHash() *Argon2idHash

func (*Argon2idHash) HashPassword

func (a *Argon2idHash) HashPassword(password string, salt []byte) (string, error)

HashPassword generates a hash of the password using Argon2id.

Jump to

Keyboard shortcuts

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