wkutil

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte, iv []byte, unPaddingFunc func([]byte) []byte) ([]byte, error)

AesDecrypt AesDecrypt

func AesDecryptPkcs5

func AesDecryptPkcs5(crypted []byte, key []byte, iv []byte) ([]byte, error)

AesDecryptPkcs5 解密

func AesDecryptPkcs7

func AesDecryptPkcs7(crypted []byte, key []byte, iv []byte) ([]byte, error)

AesDecryptPkcs7 解密

func AesDecryptPkcs7Base64

func AesDecryptPkcs7Base64(crypted []byte, key []byte, iv []byte) ([]byte, error)

AesDecryptPkcs7Base64 解密

func AesDecryptSimple

func AesDecryptSimple(crypted []byte, key string, iv string) ([]byte, error)

AesDecryptSimple 解密

func AesEncrypt

func AesEncrypt(origData []byte, key []byte, iv []byte, paddingFunc func([]byte, int) []byte) ([]byte, error)

AesEncrypt AesEncrypt

func AesEncryptPkcs5

func AesEncryptPkcs5(origData []byte, key []byte, iv []byte) ([]byte, error)

AesEncryptPkcs5 加密

func AesEncryptPkcs7

func AesEncryptPkcs7(origData []byte, key []byte, iv []byte) ([]byte, error)

AesEncryptPkcs7 加密

func AesEncryptPkcs7Base64

func AesEncryptPkcs7Base64(origData []byte, key []byte, iv []byte) ([]byte, error)

AesEncryptPkcs7Base64

func AesEncryptSimple

func AesEncryptSimple(origData []byte, key string, iv string) ([]byte, error)

AesEncryptSimple 加密

func AnyToDecimal

func AnyToDecimal(num string, n int) int64

AnyToDecimal 任意进制转10进制

func BoolToInt

func BoolToInt(b bool) int

BoolToInt bool值转换为int值

func DecimalToAny

func DecimalToAny(num int64, n int) string

DecimalToAny 10进制转任意进制

func ExecCMD

func ExecCMD(aCMD string, arg ...string) (string, error)

func GetCurve25519Key

func GetCurve25519Key(private, public [32]byte) (Key [32]byte)

GetCurve25519Key GetCurve25519Key

func GetCurve25519KeypPair

func GetCurve25519KeypPair() (Aprivate, Apublic [32]byte)

GetCurve25519KeypPair GetCurve25519KeypPair

func GetRandomString

func GetRandomString(num int) string

GetRandomString 生成随机字符串

func IntToBool

func IntToBool(b int) bool

IntToBool int值转换为bool

func JSONToMap

func JSONToMap(json string) (map[string]interface{}, error)

JSONToMap JsonToMap

func JsonToMap

func JsonToMap(json string) (map[string]interface{}, error)

func MD5

func MD5(str string) string

MD5 加密

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

PKCS5Padding PKCS5Padding

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding PKCS5UnPadding

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7Padding PKCS7Padding

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

PKCS7UnPadding PKCS7UnPadding

func ReadJSONByByte

func ReadJSONByByte(body []byte, obj interface{}) error

ReadJSONByByte 读取JSON

func ReadJsonByByte

func ReadJsonByByte(body []byte, obj interface{}) error

func RemoveRepeatedElement

func RemoveRepeatedElement(arr []string) (newArr []string)

func ToJSON

func ToJSON(obj interface{}) string

ToJSON 将对象转换为JSON

func ToJson

func ToJson(obj interface{}) string

将对象转换为JSON

Types

type WaitGroupWrapper

type WaitGroupWrapper struct {
	sync.WaitGroup
	Name string
	// contains filtered or unexported fields
}

WaitGroupWrapper waitGroup的包装结构体

func NewWaitGroupWrapper

func NewWaitGroupWrapper(name string) *WaitGroupWrapper

NewWaitGroupWrapper NewWaitGroupWrapper

func (*WaitGroupWrapper) GoroutineCount

func (w *WaitGroupWrapper) GoroutineCount() int64

GoroutineCount 协程数量

func (*WaitGroupWrapper) Wrap

func (w *WaitGroupWrapper) Wrap(cb func())

Wrap Wrap

Jump to

Keyboard shortcuts

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