tools

package
v0.0.0-...-751c537 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Log level constants
	LogLevelOff   = 0
	LogLevelInfo  = 1
	LogLevelWarn  = 2
	LogLevelError = 3
)

Variables

This section is empty.

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(password, encodedHash *string) (match bool, err error)

func CreateHash

func CreateHash(password *string) (string, error)

func GetLogLevel

func GetLogLevel() int

func LogAlways

func LogAlways(application, message string)

Always writes the message to output, useful for service messages that should always be shown

func LogError

func LogError(application, message string)

Logging for Errors, everything that was unexpected and dagerus

func LogInfo

func LogInfo(application, message string)

Logging for informations that could be handy for debugging a problem

func LogWarn

func LogWarn(application, message string)

Logging for Warnings that might be problematic, but are not specific errors

func RandomBytes

func RandomBytes(length uint32) ([]byte, error)

func RandomString

func RandomString(length uint32) (string, error)

func RandomStringCompare

func RandomStringCompare(stringOne, stringTwo *string) (bool, error)

RandomStringCompare decodes the strings and cryptographically compares them, returns true if they match

func SetLogLevel

func SetLogLevel(level int)

Types

type UsedHashParams

type UsedHashParams struct {
	Memory      uint32
	Iterations  uint32
	Parallelism uint8
	SaltLength  uint32
	KeyLength   uint32
	Salt        []byte
	// contains filtered or unexported fields
}

func DecodeHash

func DecodeHash(encodedHash *string) (params UsedHashParams, err error)

Jump to

Keyboard shortcuts

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