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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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