util

package
v0.0.0-...-8c61d13 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 15 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 AbsolutePath

func AbsolutePath(path string) string

GetAbsPath returns the absolute path to the provided path

func Adler32

func Adler32(src string) string

func ComparePassword

func ComparePassword(inputPass, hashedPass string) (bool, error)

func EntityHash

func EntityHash(name, url string) string

func EntityHashPlusString

func EntityHashPlusString(name string) string

func HashPassword

func HashPassword(pass string) (string, error)

func RandomByteSlice

func RandomByteSlice(n uint32) ([]byte, error)

func RandomCryptoString

func RandomCryptoString(n int) (string, error)

func RandomString

func RandomString(n int) string

func WorkingDirectoryPath

func WorkingDirectoryPath(p string) string

WorkingDirectoryPath returns the absolute path to the provided path

Types

type Argon2Params

type Argon2Params struct {
	Memory      uint32
	Iterations  uint32
	Parallelism uint8
	SaltLength  uint32
	KeyLength   uint32
}

Jump to

Keyboard shortcuts

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