Documentation
¶
Index ¶
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesDecryptFromBase64(b64 string, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func AesEncryptToBase64(origData, key []byte) (string, error)
- func BoolToStr(value bool) string
- func ByteToStr(value byte) string
- func Bytes2Length(ret []byte) int64
- func Crc32(src string) (string, error)
- func DecodeBase64(input string) ([]byte, error)
- func DecodeBase64Str(input string) string
- func DecodeHex(input string) ([]byte, error)
- func EncodeBase64(input string) string
- func EncodeHex(input []byte) string
- func FillPrefixToLen(in, prefix string, length int) string
- func Float32ToStr(value float32) string
- func Float32ToStrPrec2(value float32) string
- func Float64ToStr(value float64) string
- func Float64ToStrByPrec(f float64, prec int) string
- func Float64ToStrPrec2(f float64) string
- func GetCallerFuncName(skip int) string
- func GetCurDir() string
- func GetExecFolder() string
- func GetExecName() (n string)
- func GetExecPath() string
- func GetFileMd5(fi string) (string, error)
- func GetFileMd5Stream(f io.Reader) (string, error)
- func GetFuncName(i any) string
- func GetRand(start, end int) int
- func GetRandStr(n int) string
- func GetSha256(data []byte) string
- func HmacSha256(data, secret string) []byte
- func HttpDo(req *http.Request) (bodyBytes []byte, err error)
- func Int8ToStr(value int8) string
- func Int16ToStr(value int16) string
- func Int32ListExcept(baseList []int32, exclude []int32) (ret []int32)
- func Int32ListIntersect(nums1 []int32, nums2 []int32) []int32
- func Int32ListToStr(Int32List []int32, split string) string
- func Int32ListToStrWithDelimiter(Int32List []int32, split, left, right string) string
- func Int32ListUnion(nums1 []int32, nums2 []int32) []int32
- func Int32ListUnique(list []int32) []int32
- func Int32ToStr(value int32) string
- func Int64ToStr(value int64) string
- func IntToStr(value int) string
- func InterfaceToInt32(val any, defaultVal int32) int32
- func InterfaceToString(val any, defaultVal string) string
- func Length2Bytes(len int64, buffer []byte) []byte
- func Md5Sum(input ...string) string
- func NewHttpRequest(method, rawURL string, header, querys map[string]string, body string) (*http.Request, error)
- func NewHttpRequestJson(method, rawURL string, header, querys map[string]string, body any) (*http.Request, error)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func ReplaceByStringMap(str string, replaceMap map[string]string) string
- func RsaDecryptFromBase64(priKey *rsa.PrivateKey, encryptedMsg64 string) string
- func RsaEncryptToBase64(pubKey *rsa.PublicKey, msg string) string
- func RsaGetPriKey(priKeyBytes []byte) *rsa.PrivateKey
- func RsaGetPubKey(pubKeyBytes []byte) *rsa.PublicKey
- func StrFirstToLower(str string) string
- func StrFirstToUpper(str string) string
- func StrIdToLower(str string) string
- func StrListExcept(baseList []string, exclude []string) (ret []string)
- func StrListToStr(stringList []string, split string) string
- func StrListUnion(list1 []string, list2 []string) []string
- func StrListUnique(list []string) []string
- func StrListXOR(a []string, b []string) (ret []string)
- func StrToBool(value string) (bool, error)
- func StrToByte(value string) (byte, error)
- func StrToCamelCase(str string) string
- func StrToFloat32(value string) (float32, error)
- func StrToFloat64(value string) (float64, error)
- func StrToFloat64WithDefault(value string, d float64) float64
- func StrToInt(value string) (int, error)
- func StrToInt8(value string) (int8, error)
- func StrToInt16(value string) (int16, error)
- func StrToInt32(value string) (int32, error)
- func StrToInt32List(str string, split string) (ret []int32, err error)
- func StrToInt32List2(str, start, end, split string) ([]int32, error)
- func StrToInt32ListWithDelimiter(str, split, left, right string) (ret []int32, err error)
- func StrToInt32WithDefault(value string, defaultVal int32) int32
- func StrToInt64(value string) (int64, error)
- func StrToInt64WithDefault(value string, defaultVal int64) int64
- func StrToStrList(str string, split string) (ret []string)
- func StrToStrListByStartAndEnd(s string, splitStart string, splitEnd string) (ret []string)
- func StrToStrListWithEmpty(str string, split string) (ret []string)
- func StrToStrListWithSplit(str string, split string) (ret []string)
- func StrToUint(value string) (uint, error)
- func StrToUint8(value string) (uint8, error)
- func StrToUint16(value string) (uint16, error)
- func StrToUint32(value string) (uint32, error)
- func StrToUint64(value string) (uint64, error)
- func StrToUpperCamelCase(s string) string
- func TimeFromStr(timeStr, format string) (time.Time, error)
- func TimeFromStrDefault(timeStr string) (time.Time, error)
- func TimeToStr(t time.Time, format string) string
- func TimeToStrDefault(t time.Time) string
- func Uint8ToStr(value uint8) string
- func Uint16ToStr(value uint16) string
- func Uint32ToStr(value uint32) string
- func Uint64ToStr(value uint64) string
- func UintToStr(value uint) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func AesEncryptToBase64 ¶
func Bytes2Length ¶
Bytes2Length converts a byte array to an int64 value.
func DecodeBase64 ¶
DecodeBase64 decode a base64 string.
func DecodeBase64Str ¶
DecodeBase64Str decode a base64 string.
func EncodeBase64 ¶
-------------------------------------------------- EncodeBase64 converts an input string to base64 string.
func FillPrefixToLen ¶
func Float32ToStr ¶
Float32ToStr converts float32 to string.
func Float32ToStrPrec2 ¶
Float32ToStr converts float32 to string. Keep prec of 2
func Float64ToStr ¶
Float64ToStr converts float64 to string.
func Float64ToStrByPrec ¶
func Float64ToStrPrec2 ¶
Float64ToStr converts float64 to string. Keep prec of 2
func GetCallerFuncName ¶
func GetExecName ¶
func GetExecName() (n string)
func GetFileMd5Stream ¶
GetFileMd5Stream gets file's md5 by io.Reader
func GetFuncName ¶
func GetRandStr ¶
func HmacSha256 ¶
--------------------------------------------------
func Int32ListExcept ¶
差集:输出,baseList中有,exclude中没有,的元素
func Int32ListIntersect ¶
int32数组交集,输出排序是根据nums2的排序
func Int32ListToStr ¶
-------------------------------------------------- Int32ListToStr []int32 to string
func Int32ListToStrWithDelimiter ¶
--------------------------------------------------
func Int32ListUnion ¶
Int32ListUnion int32数组并集,去除重复数据
func InterfaceToInt32 ¶
--------------------------------------------------
func InterfaceToString ¶
func Length2Bytes ¶
-------------------------------------------------- Length2Bytes converts an int64 value to a byte array.
func Md5Sum ¶
-------------------------------------------------- Md5Sum calculates md5 value of some strings.
func NewHttpRequest ¶
func NewHttpRequestJson ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func ReplaceByStringMap ¶
根据替换映射表替换字符串,要注意map的数据,不要造成循环替换
func RsaDecryptFromBase64 ¶
func RsaDecryptFromBase64(priKey *rsa.PrivateKey, encryptedMsg64 string) string
func RsaGetPriKey ¶
func RsaGetPriKey(priKeyBytes []byte) *rsa.PrivateKey
func RsaGetPubKey ¶
func StrFirstToLower ¶
func StrFirstToUpper ¶
func StrIdToLower ¶
gorm-gen 工具生成的字段采用ID命名 protoc 工具生成的字段采用Id命名 使用起来依然太复杂,简单的代码替换难以分析是orm代码还是pb代码,干脆proto用ID命名就行了 本次代码提交,先保留调用,实现为空
func StrListExcept ¶
差集:输出,baseList中有,exclude中没有,的元素
func StrListToStr ¶
-------------------------------------------------- StringListToStr []string to string
func StrListUnion ¶
StrListUnion string数组并集,去除重复数据
func StrListXOR ¶
取名XOR异或,实际逻辑是(A-B)U(B-A)的集合b https://www.lodashjs.com/docs/lodash.xor
func StrToCamelCase ¶
func StrToFloat32 ¶
StrToFloat32 converts string to float32.
func StrToFloat64 ¶
StrToFloat64 converts string to float64.
func StrToFloat64WithDefault ¶
StrToFloat64 converts string to float64.
func StrToInt32List ¶
StrToInt32List string to []int32
func StrToInt32List2 ¶
func StrToInt32ListWithDelimiter ¶
StrToInt32List string to []int32
func StrToInt32WithDefault ¶
StrToInt32 converts string to int32.
func StrToInt64WithDefault ¶
StrToInt64 converts string to int64.
func StrToStrList ¶
StrToStringList string to []string, ignore empty string item
func StrToStrListWithEmpty ¶
StrToStringList string to []string, include empty string item
func StrToStrListWithSplit ¶
StrToStrList基础上,分割后不删除split字符
func StrToUint16 ¶
StrToUint16 converts string to int16.
func StrToUint32 ¶
StrToUint32 converts string to uint32.
func StrToUint64 ¶
StrToUint64 converts string to uint64.
func StrToUpperCamelCase ¶
func TimeToStrDefault ¶
Types ¶
This section is empty.