Documentation
¶
Index ¶
- func AesDecECBString(ciphertext []byte, key []byte) (string, error)
- func AesDecrypt(decryptStr string, key []byte, iv []byte) (string, error)
- func AesEncECBString(plaintext []byte, key []byte) ([]byte, error)
- func AesEncrypt(encryptStr string, key []byte, iv []byte) (string, error)
- func Base64DecodeString(text, tp string) (string, error)
- func Base64EncodeString(text []byte, tp string) string
- func CheckPhoneNumber(phoneNumber string) bool
- func ConnectSftp(user, password, host string, port int) (*sftp.Client, error)
- func ContainUpperLowerNumberSpecial(str string, num int) bool
- func EndPadByte(text []byte, pad string, size int) []byte
- func EndPadString(text, pad string, size int) string
- func FirstNonZero[T comparable](values ...T) T
- func FirstNonZeroByAny(values ...any) any
- func FormatAndSortJSON(jsonStr string) (string, error)
- func GetClientIp(c *fasthttp.RequestCtx) string
- func GetTimeByTimestamp(ts int64) string
- func GetTimestampByStr(datetime string) int64
- func GlobDir(dir string, fileList *FileListTmp) error
- func HasKeyBoardContinuousChar(pwd string, keyBoardSize int, dictionary string) bool
- func Includes[S ~[]E, E comparable](strArr S, subStr E) bool
- func IncludesAny(arr []any, s any) bool
- func InterfaceToJson(i any) (string, error)
- func IsDigit(text string) bool
- func IsEmpty(v any) bool
- func IsEmpty2(v any) bool
- func IsValidIP(ip string) bool
- func IsZero[T comparable](v T) bool
- func JSFilter[T any](s []T, f func(int, T) bool) []T
- func JSMap[T any, R any](s []T, f func(T) R) []R
- func Length(args ...string) int
- func Md5Encode(text string) string
- func Nanoid(l int) string
- func NanoidAlphabet(l int, alphabets ...string) string
- func NanoidAlphabetType(alphabetType string, l int) string
- func PathExists(path string) (bool, error)
- func SendSftp(user string, password string, host string, port int, filename string, ...) (int, error)
- func Sha256Encode(context string) string
- func ShuffleString(text string) string
- func SortKeysRecursive(v interface{}) interface{}
- func StartPadString(text, pad string, size int) string
- func SubStrStr(context, str string) string
- func Ternary[T any](condition bool, trueVal, falseVal T) T
- func TypeConversion(value string, ntype string) (reflect.Value, error)
- func Ucs2Decode(hexStr string, endianness string) (string, error)
- func Ucs2Encode(str string, endianness string) (string, error)
- func UniqueByKey[T, E comparable](data []map[T]E, key T) []map[T]E
- func UploadFileToSftp(sftpClient *sftp.Client, localFilename string, remotePath string) (int, error)
- func ValidatePhoneNumber(tel string) bool
- type FileListTmp
- type SendsReturnType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecECBString ¶ added in v0.0.20
AES-128-ECB 解密函数 pkcs5Padding
func AesDecrypt ¶
aes 解密 aes-128-cbc pkcs5Padding
func AesEncECBString ¶ added in v0.0.20
AES-128-ECB 加密函数 pkcs5Padding
func AesEncrypt ¶
aes 加密 aes-128-cbc pkcs5Padding
func Base64DecodeString ¶ added in v0.0.20
base64 decode
func Base64EncodeString ¶ added in v0.0.20
base64 encode
func ConnectSftp ¶
获取一个STFP客户端连接
func ContainUpperLowerNumberSpecial ¶
检查是否包含大小写字母以及数字和特殊字符中的指定位数
func FirstNonZero ¶ added in v0.0.20
func FirstNonZero[T comparable](values ...T) T
通用函数,返回第一个非零值 类似于js语法 a = b || c || d
func FirstNonZeroByAny ¶ added in v0.0.20
通用函数,返回第一个非零值 如果都是零值,返回最后一个参数 类似于js语法 a = b || c || d
func FormatAndSortJSON ¶ added in v0.0.20
FormatAndSortJSON 格式化并排序 JSON 字符串
func HasKeyBoardContinuousChar ¶
键盘序检查
func IncludesAny ¶
inludes interface slices.Contains 不能比较 []any
func NanoidAlphabetType ¶
按照规则获取随机字符串3 alphabetType number,upperCase,lowerCase
func SortKeysRecursive ¶ added in v0.0.20
func SortKeysRecursive(v interface{}) interface{}
SortKeysRecursive 递归对 map 的 key 排序,并处理嵌套结构
func Ucs2Decode ¶ added in v0.0.12
UCS2 解码
func Ucs2Encode ¶ added in v0.0.12
UCS2 编码
func UniqueByKey ¶ added in v0.0.20
func UniqueByKey[T, E comparable](data []map[T]E, key T) []map[T]E
对[]map[string]any进行去重
Types ¶
type FileListTmp ¶
type FileListTmp struct {
DirBase string
Files []string
Childs []*FileListTmp
}
Click to show internal directories.
Click to hide internal directories.