util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfig = `` /* 1556-byte string literal not displayed */

Variables

This section is empty.

Functions

func AESCBCDecrypt added in v0.1.0

func AESCBCDecrypt(cryted string, key string) (string, error)

func AESCBCEncrypt added in v0.1.0

func AESCBCEncrypt(orig string, key string) (string, error)

func EncryptAPIResp added in v0.1.0

func EncryptAPIResp(plainText string) string

EncryptAPIResp 加密API响应内容

func GetConfigKey

func GetConfigKey(appName, appEnv, target, port string) string

func Hostname

func Hostname() (string, error)

func IP

func IP() (string, error)

func InStringArray added in v0.1.0

func InStringArray(arr []string, str string) int

InStringArray if str in arr, return index. or return -1

func MD5

func MD5(text string) string

生成32位MD5

func MkdirAll

func MkdirAll(filePath string) error

func PKCS7Padding added in v0.1.0

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

补码, len = 128||192||256 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。

func PKCS7UnPadding added in v0.1.0

func PKCS7UnPadding(origData []byte) []byte

去码

func ReadDirFiles

func ReadDirFiles(dir string, appName string) (result map[string]string, err error)

func WriteFile

func WriteFile(filePath string, content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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