gfunc

package module
v0.0.0-...-b8c516d Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

README

gfunc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES_CBC_Base64_Decrypt

func AES_CBC_Base64_Decrypt(data string, keysize int, key, iv []byte) ([]byte, error)

func AES_CBC_Base64_Encrypt

func AES_CBC_Base64_Encrypt(data []byte, keysize int, key, iv []byte) (string, error)

func AES_CBC_Decrypt

func AES_CBC_Decrypt(data []byte, keysize int, key, iv []byte) (ret []byte, err error)

aes cbc算法模式 解密

func AES_CBC_Encrypt

func AES_CBC_Encrypt(data []byte, keysize int, key, iv []byte) (ret []byte, err error)

aes cbc算法模式 加密

func AnsiToUtf8

func AnsiToUtf8(src string) string

func AppFileName

func AppFileName() string

func AppFilePath

func AppFilePath() string

获取当前运行程序所在的路径

func AppendBytes2File

func AppendBytes2File(filename string, content []byte) error

func AppendStr2File

func AppendStr2File(filename string, content string) error

func Base64Decode

func Base64Decode(v string) []byte

func Base64Encode

func Base64Encode(v []byte) string

func Bytes2Hex

func Bytes2Hex(v []byte) string

func Bytes2String

func Bytes2String(v []byte) string

将byte数据转为string 若byte数据中存在0x0 则只取0x0前的数据

func BytesMerge

func BytesMerge(v ...[]byte) []byte

func BytesMergeA

func BytesMergeA(v ...*[]byte) *[]byte

func CharInSet

func CharInSet(v byte, s ...interface{}) bool

func CombineCount

func CombineCount(m, n int) (ret int)

从m个数中选取n个数的组合个数

func CombineSplit2Index

func CombineSplit2Index(m, n int) (retv [][]int)

func ConvertCharacterSet

func ConvertCharacterSet(srcData, srcCharacterSet, dstCharacterSet string) string

func CurrDate2Str

func CurrDate2Str() string

将当前系统的日期转为字符串

func CurrDateTime2Str_Micro

func CurrDateTime2Str_Micro() string

将当前系统的日期时间转为字符串 精确到微秒

func CurrDateTime2Str_Mill

func CurrDateTime2Str_Mill() string

将当前系统的日期时间转为字符串 精确到毫秒

func CurrDateTime2Str_Sec

func CurrDateTime2Str_Sec() string

将当前系统的日期时间转为字符串 精确到秒

func CurrTime2Str_Micro

func CurrTime2Str_Micro() string

将当前系统的时间转为字符串 精确到微秒

func CurrTime2Str_Mill

func CurrTime2Str_Mill() string

将当前系统的时间转为字符串 精确到毫秒

func CurrTime2Str_Sec

func CurrTime2Str_Sec() string

将当前系统的时间转为字符串 精确到秒

func CurrUnixNanoTime

func CurrUnixNanoTime() int64

func CurrUnixTime

func CurrUnixTime() int64

func DateSame

func DateSame(tm1, tm2 time.Time) bool

func DateTime2Str_Micro

func DateTime2Str_Micro(t time.Time) string

func DateTime2Str_Mill

func DateTime2Str_Mill(t time.Time) string

func DateTime2Str_Sec

func DateTime2Str_Sec(t time.Time) string

func DirExist

func DirExist(v string) bool

判断文件夹是否存在

func ExtractFileDir

func ExtractFileDir(filename string) (ret string)

func ExtractFileExt

func ExtractFileExt(filename string) (ret string)

func ExtractFileName

func ExtractFileName(filename string) (ret string)

func ExtractFilePath

func ExtractFilePath(filename string) (ret string)

func FileExist

func FileExist(v string) bool

判断文件是否存在

func FileRename

func FileRename(srcname, dstname string) error

func Float32Abs

func Float32Abs(v float32) float32

func Float64Abs

func Float64Abs(v float64) float64

func Float64ToStr

func Float64ToStr(v float64) string

func ForceDirectories

func ForceDirectories(v string) bool

创建文件夹 文件夹存在或创建成功返回true 否则返回false

func GbkToUtf8

func GbkToUtf8(v string) string

func GetFileContent

func GetFileContent(filename string) ([]byte, error)

获取文件内容

func GetFileContent2Str

func GetFileContent2Str(filename string) (string, error)

func GetFileSize

func GetFileSize(filename string) int64

获取文件的大小(单位是字节)

func HMACSHA1

func HMACSHA1(data, key []byte) []byte

func Hex2Bytes

func Hex2Bytes(v string) []byte

func HttpDataSizeGet

func HttpDataSizeGet(geturl string, headers map[string]string, params map[string]string) uint64

func HttpGet

func HttpGet(geturl string, headers map[string]string, params map[string]string) []byte

func HttpGetA

func HttpGetA(geturl string, headers map[string]string, params map[string]string, transport http.RoundTripper) ([]byte, error)

func HttpGetWithProxy

func HttpGetWithProxy(geturl, proxyUrl string, headers map[string]string, params map[string]string) ([]byte, error)

func HttpPost

func HttpPost(posturl string, headers map[string]string, params map[string]string) []byte

func HttpPostA

func HttpPostA(posturl string, headers map[string]string, params map[string]string, transport http.RoundTripper) ([]byte, error)

func HttpPostWithProxy

func HttpPostWithProxy(posturl, proxyUrl string, headers map[string]string, params map[string]string) ([]byte, error)

func HttpTransport

func HttpTransport(proxyUrl string, timeoutSec, keepAliveSec int) (*http.Transport, error)

func Int32Abs

func Int32Abs(v int32) int32

func Int64Abs

func Int64Abs(v int64) int64

func Int64ToStr

func Int64ToStr(v int64) string

func IntAbs

func IntAbs(v int) int

func IntInSet

func IntInSet(v int, s ...interface{}) bool

func Md5Bytes

func Md5Bytes(v []byte) string

func Md5String

func Md5String(v string) string

func MoveFile

func MoveFile(srcname, dstname string) error

func PKCS5Padding

func PKCS5Padding(ciphertext []byte) []byte

func PKCS5UnPadding

func PKCS5UnPadding(data []byte) []byte

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(data []byte) []byte

func ParseStrDate

func ParseStrDate(str string) (time.Time, error)

func ParseStrDateInLocation

func ParseStrDateInLocation(str string, location *time.Location) (time.Time, error)

func ParseStrDateTime

func ParseStrDateTime(str string) (time.Time, error)

func ParseStrDateTimeInLocation

func ParseStrDateTimeInLocation(str string, location *time.Location) (time.Time, error)

func ParseStrTime

func ParseStrTime(str string) (time.Time, error)

func ParseStrTimeInLocation

func ParseStrTimeInLocation(str string, location *time.Location) (time.Time, error)

func RemoveFile

func RemoveFile(filename string) error

func SHA1String

func SHA1String(v []byte) string

func SearchFiles

func SearchFiles(dirPath string, suffixs []string, containSubDir bool) (filenames []string, err error)

根据参数获取目录下的文件名

func Str2Date

func Str2Date(v string) time.Time

func Str2DateTime

func Str2DateTime(v string) time.Time

func Str2LocalDate

func Str2LocalDate(v string) time.Time

func Str2LocalDateTime

func Str2LocalDateTime(v string) time.Time

func Str2LocalTime

func Str2LocalTime(v string) time.Time

func Str2Time

func Str2Time(v string) time.Time

func Str2UtcDate

func Str2UtcDate(v string) time.Time

func Str2UtcDateTime

func Str2UtcDateTime(v string) time.Time

func Str2UtcTime

func Str2UtcTime(v string) time.Time

func StrToDate

func StrToDate(v string, location *time.Location) time.Time

func StrToDateTime

func StrToDateTime(v string, location *time.Location) time.Time

func StrToFloat32

func StrToFloat32(v string) float32

func StrToFloat32Def

func StrToFloat32Def(v string, d float32) float32

func StrToFloat64

func StrToFloat64(v string) float64

func StrToFloat64Def

func StrToFloat64Def(v string, d float64) float64

func StrToInt

func StrToInt(v string) int

func StrToInt32

func StrToInt32(v string) int32

func StrToInt32Def

func StrToInt32Def(v string, d int32) int32

func StrToInt64

func StrToInt64(v string) int64

func StrToInt64Def

func StrToInt64Def(v string, d int64) int64

func StrToIntDef

func StrToIntDef(v string, d int) int

func StrToTime

func StrToTime(v string, location *time.Location) time.Time

func StrToUInt64

func StrToUInt64(v string) uint64

func StrToUInt64Def

func StrToUInt64Def(v string, d uint64) uint64

func StringTrim

func StringTrim(v string) (ret string)

func UInt64ToStr

func UInt64ToStr(v uint64) string

func UnGZIP

func UnGZIP(v []byte) (ret []byte)

func UnGZip

func UnGZip(v []byte) (r []byte, e error)

func UnGZipA

func UnGZipA(ior io.Reader) (r []byte, e error)

func Utf8ToAnsi

func Utf8ToAnsi(src string) string

func Utf8ToGbk

func Utf8ToGbk(v string) string

func WriteBytes2File

func WriteBytes2File(filename string, content []byte) error

func WriteStr2File

func WriteStr2File(filename string, content string) error

func XorEncrypt

func XorEncrypt(src []byte, key []byte) []byte

func YestodayDate2Str

func YestodayDate2Str() string

将昨天的日期转化为字符串

func ZBase64Compress

func ZBase64Compress(v []byte) string

先zlib压缩再base64加密

func ZBase64Decompress

func ZBase64Decompress(v string) []byte

先base64解密再zlib解压

func ZBase64DecompressA

func ZBase64DecompressA(v string) (r []byte, e error)

func ZlibCompress

func ZlibCompress(v []byte) []byte

func ZlibDecompress

func ZlibDecompress(v []byte) []byte

func ZlibDecompressA

func ZlibDecompressA(v []byte) (retr []byte, rete error)

Types

This section is empty.

Directories

Path Synopsis
This package is a character-set conversion library for Go.
This package is a character-set conversion library for Go.

Jump to

Keyboard shortcuts

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