Versions in this module Expand all Collapse all v0 v0.3.0 Nov 21, 2023 Changes in this version + var Browsers = []string + var ErrInvalidPadding = errors.New("aes invalid padding") + var IntranetIPs = append(LocalIPs, "10.0.0.0/8", "172.31.0.0/16", "172.16.0.0/16", "192.168.0.0/16") + var LocalIPs = []string + var Platforms = []string + var SpecialIPs = make([]*net.IPNet, 0, len(IntranetIPs)) + func AesDecrypt(key []byte, data []byte, unpadding UnPaddingFunc) ([]byte, error) + func AesEncrypt(key []byte, data []byte, padding PaddingFunc) ([]byte, error) + func Assign(ptr interface{}, val interface{}) + func BeanCopy(src, dst interface{}) error + func BeanCopyByJson(source, result interface{}) error + func Bool2Int(b bool) int64 + func BytesToInt16(b []byte) int16 + func BytesToInt32(b []byte) int32 + func BytesToInt64(b []byte) int64 + func BytesToUint16(b []byte) uint16 + func BytesToUint32(b []byte) uint32 + func BytesToUint64(b []byte) uint64 + func CharCount(s string) int + func Contain(array interface{}, val interface{}) bool + func ContainsString(slice []string, s string) bool + func Find(array interface{}, val interface{}) int + func GetBase64Md5(raw []byte) string + func GetDevice(req *http.Request, body url.Values) *model.Device + func GetDeviceType(req *http.Request, body url.Values) string + func GetMd5(raw []byte) string + func GetRealBrowser(ua string) string + func GetRealIP(r *http.Request) string + func GetRealPlatform(ua string) string + func GetVersion(ua string, keyword string) string + func Int16ToBytes(u int16) []byte + func Int2Bool(i int64) bool + func Int32ToBytes(u int32) []byte + func Int64ToBytes(u int64) []byte + func IsCommonBrowser(browser string) bool + func IsCommonPlatform(platform string) bool + func IsEmail(email string) bool + func IsValidCellPhone(phonenumber string) bool + func Join(array interface{}, sep string) string + func JoinInts(a []int64, sep string) string + func Map(mapping func(interface{}) interface{}, strs ...interface{}) []interface + func Map2Struct(vals map[string]interface{}, dst interface{}, structTag string) (err error) + func NowMsec() int64 + func ParseCellPhone(phonenumber string) (region string, phone string) + func Pkcs5Padding(data []byte) []byte + func Pkcs5Unpadding(data []byte) ([]byte, error) + func Remove(ptrArray interface{}, val interface{}) int + func Reverse(array interface{}) + func Slice(s string) (b []byte) + func SpIpInit() + func SplitFilename(fname string) (base string, ext string) + func String(b []byte) (s string) + func Struct2Map(s interface{}) map[string]interface + func Struct2MapByTag(s interface{}, tagName string) map[string]interface + func ToExportBrowser(browser string) string + func Uint16ToBytes(u uint16) []byte + func Uint32ToBytes(u uint32) []byte + func Uint64ToBytes(u uint64) []byte + type PaddingFunc func([]byte) []byte + type UnPaddingFunc func([]byte) ([]byte, error)