crypto

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MD5    = crypto.MD5
	SHA256 = crypto.SHA256
	SHA512 = crypto.SHA512
)

crypto.Hash

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 BcryptSimple added in v0.0.7

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

func GenerateSalt added in v0.0.5

func GenerateSalt(lengths ...int) (types.Bytes, error)

func GenerateSecretKey

func GenerateSecretKey(lengths ...int) (types.Bytes, 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