crypto

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultSecretKeyLength = 32 // 32byte = 256bit
	DefaultSaltLength      = 32
)
View Source
const (
	DefaultLoopNumber = 2048
)

Variables

This section is empty.

Functions

func Bcrypt added in v0.0.5

func Bcrypt(data, salt []byte, loops ...int) ([]byte, error)

慢哈希加盐

func GenerateSalt added in v0.0.5

func GenerateSalt(lengths ...int) ([]byte, error)

func GenerateSecretKey

func GenerateSecretKey(lengths ...int) ([]byte, error)

生成指定字节长度的密钥

func HashCode added in v0.0.6

func HashCode(key string) int

HashCode generate hash code

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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