_commUtils

package
v0.0.0-...-add256a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(crypted, key []byte) ([]byte, error)

func AesCBCEncrypt

func AesCBCEncrypt(origData, key []byte) ([]byte, error)

func ArrayRemoveDuplication

func ArrayRemoveDuplication(arr []string) []string

func ArrayRemoveIntDuplication

func ArrayRemoveIntDuplication(arr []int) []int

func ArrayRemoveUintDuplication

func ArrayRemoveUintDuplication(arr []uint) []uint

func ArrayUnique

func ArrayUnique(arr []string) (ret []string)

func Base

func Base(pathStr string) string

func Camel2Case

func Camel2Case(name string) (ret string)

驼峰式写法转为下划线写法

func Case2Camel

func Case2Camel(name string) string

下划线写法转为驼峰写法

func Difference

func Difference(slice1, slice2 []string) []string

Difference 差集

func DifferenceUint

func DifferenceUint(slice1, slice2 []uint) []uint

DifferenceUint 差集

func EncryptHmacMd5

func EncryptHmacMd5(key, data string) string

func GetEnvVar

func GetEnvVar(name, def string) (ret string)

func GetIp

func GetIp() (ip net.IP, mac net.HardwareAddr)

func GetOs

func GetOs() string

func GetSign

func GetSign(appKey, appSecret, nonce, timestamp, body string) (sign string)

func GetUserHome

func GetUserHome() string

func GetValidPort

func GetValidPort(start int, end int, existPortMap *map[int]bool) (ret int)

func InArray

func InArray(target string, array []string) bool

func InSlice

func InSlice(target string, strArray []string) bool

InSlice 判断字符串是否在切片中

func IntInSlice

func IntInSlice(target int, intArray []int) bool

IntInSlice 判断uint是否在切片中

func IntToStrArr

func IntToStrArr(intArr []int) (strArr []string)

func Intersect

func Intersect(slice1, slice2 []string) []string

Intersect 求交集

func IntersectUint

func IntersectUint(slice1, slice2 []uint) []uint

IntersectUint 求交集

func IsDisable

func IsDisable(enable string) bool

func IsLinux

func IsLinux() bool

func IsMac

func IsMac() bool

func IsPortInUse

func IsPortInUse(port int) bool

func IsRelease

func IsRelease() bool

func IsWin

func IsWin() bool

func JsonDecode

func JsonDecode(str string, res interface{}) (err error)

func JsonEncode

func JsonEncode(data interface{}) (res string)

func LinkedMapToMap

func LinkedMapToMap(mp maps.Map) map[string]string

func Map2Struct

func Map2Struct(m interface{}, s interface{})

func NewSliceValue

func NewSliceValue(vals []string, p *[]string) *sliceValue

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RandStr

func RandStr(n int) string

func RemoveBlankLine

func RemoveBlankLine(str string) string

func Sha256

func Sha256(src string) string

Sha256 Sha256加密

func UintArrToStr

func UintArrToStr(arr []uint) (res string)

func UintToStrArr

func UintToStrArr(intArr []uint) (strArr []string)

func UpdateUrl

func UpdateUrl(url string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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