crypt

package
v0.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Algo_Argon2       = "Argon2"
	Argon2_Memory     = 524288
	Argon2_Operations = 4
	Argon2_Time       = 1
	Argon2_Threads    = 1
	Argon2_SaltBytes  = 8
	Argon2_StrBytes   = 128
)

Variables

This section is empty.

Functions

func InitTlsPairCa

func InitTlsPairCa(hosts []string, ca_path, key_path, crt_path string) error

func RandBytes

func RandBytes(size int) (data []byte)

Create random bytes of specified size

func RandString

func RandString(size int) string

Create random string of specified size

Types

type Hash

type Hash struct {
	Algo string
	Salt []byte
	Hash []byte
}

func Generate

func Generate(password string, salt []byte) (hash Hash)

Generate a salted hash for the input string

func (*Hash) IsEmpty

func (hash *Hash) IsEmpty() bool

func (*Hash) IsEqual

func (hash *Hash) IsEqual(password string) bool

Compare string to generated hash

Jump to

Keyboard shortcuts

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