Documentation ¶
Index ¶
- func AESDecrypt(data []byte, key []byte) ([]byte, error)
- func AESEncrypt(data []byte, key []byte) ([]byte, error)
- func ComparePasswords(hashedPassword, inputPassword string) (bool, error)
- func CountSubString(s string, separator string) int
- func DaysInMonth(year, month int) int
- func DecryptByAES(data, key string) (string, error)
- func ElementExist(value interface{}, sli interface{}) bool
- func EncryptByAES(data, key string) (string, error)
- func HashPassword(password string) (string, error)
- func HttpDo(method, url string, headers, query map[string]string, b string) (*http.Response, []byte, error)
- func HumanFormatTimeSeconds(seconds int) string
- func Intersect(o, n []string) []string
- func IsMail(mail string) bool
- func IsSliceEqual(a, b interface{}) bool
- func IsSubSlices(sub []string, sli []string) bool
- func IsTimeInRange(t time.Time, startTime, endTime string) (bool, error)
- func NonIntersect(o, n []string) []string
- func ParseAddr(addr, defHost string, defPort int) (string, int, error)
- func RandStr(length int) string
- func RemoveDupElement[T comparable](sli []T) []T
- func RemoveSubSlices(sli []string, del []string) []string
- func SliceToString[T any](sli []T, separator string) string
- func Ternary[T any](b bool, v1, v2 any) T
- func TrimmingSQLConditionEnding(condition string) string
- func TrimmingStringList(org, split string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
ComparePasswords 使用bcrypt库的CompareHashAndPassword函数比较密码
func CountSubString ¶
func DaysInMonth ¶
func ElementExist ¶
func ElementExist(value interface{}, sli interface{}) bool
ElementExist 切片是否包含某个元素
func EncryptByAES ¶
EncryptByAES 使用AES加密data, key的长度只支持16、32、64 Byte
func HashPassword ¶
HashPassword 使用bcrypt库的GenerateFromPassword函数进行哈希处理
func HumanFormatTimeSeconds ¶
HumanFormatTimeSeconds 将秒转换为便于人阅读的格式
func IsTimeInRange ¶
IsTimeInRange 时间是否在某个区间内
func NonIntersect ¶
func RemoveDupElement ¶
func RemoveDupElement[T comparable](sli []T) []T
RemoveDupElement 切片元素去重(字符串)
func RemoveSubSlices ¶
RemoveSubSlices 删除子切片元素
func SliceToString ¶
func TrimmingSQLConditionEnding ¶
TrimmingSQLConditionEnding 修剪where条件后多余的空格和";"
func TrimmingStringList ¶
TrimmingStringList 修剪字符串去除多余的空格字符(会去除重复项!!!)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.