utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArgon2HashingParams = &Argon2HashingParam{
	memory:      64 * 1024,
	iterations:  3,
	parallelism: 4,
	saltLength:  16,
	keyLength:   32,
}
View Source
var ErrIncompatibleVersion = errors.New("incompatible version of argon2")
View Source
var ErrInvalidHash = errors.New("the encoded hash is not in the correct format")

Functions

func ArrayStringContians added in v0.1.7

func ArrayStringContians(s []string, searchterm string) (int, bool)

func AssertPanic added in v0.0.3

func AssertPanic(t *testing.T, callback func(), expectPanic interface{})

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CheckPasswordHashWithArgon2

func CheckPasswordHashWithArgon2(password, encodedHash string) (match bool, err error)

func HashPassword

func HashPassword(password string) (string, error)

func HashPasswordWithArgon2

func HashPasswordWithArgon2(password string, params *Argon2HashingParam) (string, error)

func JSONMapper

func JSONMapper(src interface{}, dest interface{}) error

func NewDecoder added in v0.1.1

func NewDecoder(b64 string) *decoder

func NewEncoder added in v0.1.1

func NewEncoder(plaintext *string) *encoder

func RunUntil added in v0.1.1

func RunUntil(callback func() bool, duration time.Duration)

Types

type Argon2HashingParam

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

Jump to

Keyboard shortcuts

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