database

package
v0.0.0-...-0adf664 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncompatableArgon2Version error = errors.New("incompatable argon2 version")
	ErrInvalidArgon2FieldCount   error = errors.New("invalid number of fields")
)

Functions

func CreateUser

func CreateUser(data struct {
	Username string
	Email    string
	Password string
}) error

func DecodeHash

func DecodeHash(hash string, data *Argon2Params) error

func GenerateHash

func GenerateHash(secret string) (string, error)

func VerifyHash

func VerifyHash(secret, hash string) bool

Types

type Argon2Params

type Argon2Params struct {
	Version int
	Time    uint32
	Memory  uint32
	Threads uint8
	KeyLen  uint32
	Salt    []byte
	Key     []byte
}

Jump to

Keyboard shortcuts

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