util

package
v0.0.0-...-0b9a7cd Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecryptCBC

func AesDecryptCBC(encrypted []byte, key []byte) (decrypted []byte)

func AesEncryptCBC

func AesEncryptCBC(origData []byte, key []byte) (encrypted []byte)

=================== CBC ======================

func GenerateRSAKey

func GenerateRSAKey(bits int) (err error, publicKeyText []byte, privateKeyText []byte)

GenerateRSAKey 生成RSA私钥和公钥,保存到文件中

func GenerateRSAKeyFile

func GenerateRSAKeyFile(bits int, savedKeyFilePath string) (err error)

GenerateRSAKeyFile 生成RSA私钥和公钥,保存到文件中

func Md5Crypt

func Md5Crypt(str string, salt ...interface{}) (CryptStr string)

MD5加密 @param str 需要加密的字符串 @param salt 盐值 @return CryptStr 加密后返回的字符串

func RSADecryptFromPemText

func RSADecryptFromPemText(cipherText []byte, pemFileText []byte) (plainText []byte, err error)

RSADecryptFromPemText RSA解密

func RandomString

func RandomString(length int) string

func SocketReceive

func SocketReceive(conn *websocket.Conn) ([]byte, error)

func SocketSend

func SocketSend(conn *websocket.Conn, byteData []byte) error

func UniqueId

func UniqueId() string

生成Guid字串

Types

This section is empty.

Jump to

Keyboard shortcuts

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