crypto

package
v0.0.0-...-689d12e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)

Functions

func ComparePasswordAndHash

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

func GeneratePasswordHash

func GeneratePasswordHash(password string) (string, error)

Types

type Argon2idHash

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

func NewArgon2idHash

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

NewArgon2idHash constructor function for Argon2idHash.

func NewDefaultArgon2idHash

func NewDefaultArgon2idHash() *Argon2idHash

type HashSalt

type HashSalt struct {
	Hash, Salt []byte
}

HashSalt struct used to store generated hash and salt used to generate the hash.

Jump to

Keyboard shortcuts

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