Documentation ¶
Index ¶
- func Base58Decode(str string) (string, error)
- func Base58Encode(str string) string
- func Base64Decode(s string) ([]byte, error)
- func Base64Encode(b []byte) string
- func Base64UrlDecode(s string) ([]byte, error)
- func Base64UrlEncode(b []byte) string
- func CheckInt64ForTimestamp(value int64) int64
- func Contains[T int | int8 | int32 | int64 | string](slice []T, s T) int
- func ContainsSubString(src string, sub string) bool
- func ConvertGBK2Str(gbkStr string) string
- func ConvertStr2GBK(str string) string
- func DateNumberString(t time.Time) string
- func DateString(t time.Time) string
- func DateTimeString(t time.Time) string
- func Float32ToString(n float32) string
- func Float64AddFloat64(a float64, b float64) float64
- func Float64DivFloat64(a float64, b float64) float64
- func Float64SubFloat64(a float64, b float64) string
- func Float64ToPercentStr(x float64) string
- func Float64ToString(n float64) string
- func GenerateGuid() string
- func GenerateUUID() string
- func GetCurrentDateNumber() string
- func GetCurrentDateStr() string
- func GetCurrentDateTimeNumber() string
- func GetDaysBetweenTwoTimestamp(start int64, end int64) float64
- func GetEndTimestamp(sec int64) int64
- func GetFloat(unk interface{}) (float64, error)
- func GetHmacMD5(secret string, data string) string
- func GetHmacSHA1(secret string, data string) string
- func GetHmacSHA256(secret string, data string) string
- func GetMD5(str string) (md5str string)
- func GetNowTimestamp() int64
- func GetSHA1(data string) string
- func GetSHA256(data string) string
- func GetStartTimestamp(sec int64) int64
- func GetTodayEndTimestamp() int64
- func GetTodayStartTimestamp() int64
- func GetTomorrowStartTimestamp() int64
- func GetYesterdayStartTimestamp() int64
- func HexToInt(hexString string) (int64, error)
- func HmacMD5(secret string, data []byte) []byte
- func HmacSHA1(secret string, data []byte) []byte
- func HmacSHA256(secret string, data []byte) []byte
- func IndexOf(array []string, s string) int
- func Int2Str(i int) string
- func Int32ToString(n int32) string
- func Int64ToString(value int64) string
- func Int64Totime(value int64) time.Time
- func IntDivInt(a int, b int) int
- func IntSlice2StrSlice(intSlice []int) []string
- func IntToString(x int) string
- func InterfaceToFloat64(x interface{}) float64
- func InterfaceToSqlString(x interface{}) string
- func InterfaceToString(x interface{}) string
- func IsDigit(str string) bool
- func IsIntegerMultiple(value int32, base int32) bool
- func IsOdd(num int) bool
- func JoinIntSlice2String(intSlice []int, sep string) string
- func JoinSepStrings(sep string, multiString ...string) string
- func JoinStrings(multiString ...string) string
- func JsonDecode(jsonString string, obj interface{}) error
- func JsonEncode(obj interface{}) (string, error)
- func JsonToObj(jsonString string, obj interface{}) error
- func KeepDecimal(val float64, n int) float64
- func KeepDecimalToString(val float64, n int, zeroFill bool) string
- func MD5(data []byte) []byte
- func Merge[T int | int8 | int32 | int64 | string](arrays ...[]T) []T
- func MergeAndRemoveDuplicate[T int | int8 | int32 | int64 | string](arrays ...[]T) []T
- func NowToDateTimeStr() string
- func ObjToJson(obj interface{}) string
- func RFC3339ToCSTLayout(value string) (string, error)
- func RFC3339ToInt64(value string) int64
- func RandomCustomStr(strs []byte, length int) string
- func RandomInt(length int) string
- func RandomStr(length int) string
- func RemoveDuplicate[T int | int8 | int32 | int64 | string](arr []T) []T
- func ReplaceByStar(mobile string) string
- func ReplaceEmailByStar(email string) string
- func ReplaceIdCardByStar(idCard string) string
- func ReplaceNameWithAsterisk(name string) string
- func Reverse(s string) string
- func SHA1(data []byte) []byte
- func SHA256(data []byte) []byte
- func Str2Int(s string) int
- func Str2Int64(s string) int64
- func StrFilterSliceEmpty(strSlice []string) []string
- func StrMd5(s string) string
- func StrSlice2IntSlice(strSlice []string) []int
- func StrSplit2IntSlice(str, sep string) []int
- func StrToTimestamp(str string) int64
- func StringArrayToInt64Array(sa []string) ([]int64, error)
- func StringSliceRsort(s []string) []string
- func StringToBigInt(s string) *big.Int
- func StringToFloat32(s string) float32
- func StringToFloat64(s string) float64
- func StringToInt(s string) int
- func StringToInt32(s string) int32
- func StringToInt64(s string) int64
- func StringToInt64Array(str string) ([]int64, error)
- func Struct2Map(obj interface{}) map[string]interface{}
- func Substr(str string, start, length int) string
- func TimePointToTimestamp(timePoint string) int64
- func TimestampToStr(sec int64) string
- func TimestampToStrDate(sec int64) string
- func YyyyMMddHHmmssToTimestamp(str string) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base58Decode ¶
func Base64Decode ¶
func Base64Encode ¶
func Base64UrlDecode ¶
func Base64UrlEncode ¶
func ConvertGBK2Str ¶
func ConvertStr2GBK ¶
func DateNumberString ¶
func DateString ¶
func DateTimeString ¶
func Float32ToString ¶
func Float64AddFloat64 ¶
func Float64SubFloat64 ¶
func Float64ToString ¶
func GenerateUUID ¶
func GenerateUUID() string
func GetCurrentDateStr ¶
func GetCurrentDateStr() string
func GetCurrentDateTimeNumber ¶
func GetCurrentDateTimeNumber() string
func GetDaysBetweenTwoTimestamp ¶
获取2个时间戳之间的天数
func GetHmacMD5 ¶
func GetHmacSHA1 ¶
func GetHmacSHA256 ¶
func HmacSHA256 ¶
func Int64Totime ¶
func IntSlice2StrSlice ¶
func IntToString ¶
func InterfaceToFloat64 ¶
func InterfaceToFloat64(x interface{}) float64
func InterfaceToSqlString ¶
func InterfaceToSqlString(x interface{}) string
func InterfaceToString ¶
func InterfaceToString(x interface{}) string
func JoinIntSlice2String ¶
func JoinSepStrings ¶
func JoinStrings ¶
func JsonDecode ¶
func JsonEncode ¶
func MergeAndRemoveDuplicate ¶
合并且去重
func NowToDateTimeStr ¶
func NowToDateTimeStr() string
func RFC3339ToCSTLayout ¶
将 2020-11-08T08:18:46+08:00 转成 2020-11-08 08:18:46
func RFC3339ToInt64 ¶
func RandomCustomStr ¶
func StrFilterSliceEmpty ¶
func StrSlice2IntSlice ¶
func StrSplit2IntSlice ¶
func StringArrayToInt64Array ¶
字符串数组转成int64数组
func StringSliceRsort ¶
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
func YyyyMMddHHmmssToTimestamp ¶
14位格式(yyyyMMddHHmmss)字符串转换为时间戳
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.