util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(content, key string, mode ...string) (res string, err error)

AESDecrypt aes解密

func AESEncrypt

func AESEncrypt(content, key string, mode ...string) (res string, err error)

AESEncrypt aes加密

func CheckInArray

func CheckInArray(value string, input []string) bool

CheckInArray 检查数组中是否存在某元素

func CheckInMap

func CheckInMap(key string, input map[string]interface{}) bool

CheckInMap 检查map中是否存在某键值对,值不能为空

func DESDecrypt

func DESDecrypt(input string, skey string, mode ...string) (r string, err error)

DESDecrypt DES解密

func DESEncrypt

func DESEncrypt(input string, skey string, mode ...string) (r string, err error)

DESEncrypt des加密

func GenRsaKey

func GenRsaKey(pkcsType string, bits int) (pubKey, priKey string, err error)

GenRsaKey RSA密钥对生成

func GetSecret

func GetSecret(l int) string

GetSecret 获取l位随机数字的字符串密钥

func GetSecretExtra

func GetSecretExtra(l int) string

GetSecretExtra .

func HmacEncrypt

func HmacEncrypt(data, key string) string

HmacEncrypt HMAC加密

func MD5

func MD5(str string) string

MD5 生成字符串md5

func RSADecrypt

func RSADecrypt(origin, key, pkcsType string) (string, error)

RSADecrypt RSA私钥解密

func RSAEncrypt

func RSAEncrypt(origData, publicKey, pkcsType string) (data string, err error)

RSAEncrypt RSA公钥加密

func RSASign

func RSASign(message, privateKey, mode, pkcsType string) (string, error)

RSASign RSA签名

func RSASignVerify

func RSASignVerify(src, sign, publicKey, mode, pkcsType string) (pass bool, err error)

RSASignVerify RSA签名验证

func Sha1Encrypt

func Sha1Encrypt(raw string) string

Sha1Encrypt Sha1加密

func Sha256Encrypt

func Sha256Encrypt(raw string) string

Sha256Encrypt Sha256加密

func Sha512Encrypt

func Sha512Encrypt(raw string) string

Sha512Encrypt Sha512加密

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