hash

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SaltLength = 36
	KeyLength  = 512
	Iter       = 10000
)

SaltLength specifies the length of a random byte sequence. KeyLength, Iter for pbkdf2.Key arguments.

Functions

func Compare

func Compare(str, hexStr string) (bool, error)

CompareHexHash to compare passed string as hex string.

func CompareHex

func CompareHex(hash func() hash.Hash, str, hexStr, key string) (bool, error)

CompareHexHash to compare passed string and PBDKF2 as hex string.

func New

func New(secret, data string) string

func NewHex

func NewHex(hash func() hash.Hash, str string) (string, string, error)

HexHash to generate PBDKF2 as Hex string. returns PBDKF2, secret key, error

func PBDKF2Hex

func PBDKF2Hex(hash func() hash.Hash, str string, key []byte) string

PBDKF2Hex creates a hex string from PBDKF2 as its name

func RandomBytes

func RandomBytes(l int) ([]byte, error)

RandomBytes generate a random byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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