utils

package
v0.0.0-...-279ef49 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B2s

func B2s(b []byte) string

func Base64WrapRFC2045

func Base64WrapRFC2045(src []byte) (m string)

Base64WrapRFC2045 返回符合 RFC 2045 的Base64 encoded结果(每76个字符添加\n)

func CompareHideString

func CompareHideString(first, second, hide string) bool

func Elapsed

func Elapsed() interface {
	Stop()
}

func EqualFloat64

func EqualFloat64(f1 interface{}, f2 interface{}) (int, error)

EqualFloat64 比较float64 f1 f2可以是字符串或者float64

func ExternalIP

func ExternalIP() (res []string)

ExternalIP get external ip.

func FormatJSONStr

func FormatJSONStr(str string) string

FormatJSONStr format no-stand json str

func GenFakeEmail

func GenFakeEmail(prefix string) string

GenFakeEmail 生成假的email地址

func GenFakeMobile

func GenFakeMobile() string

GenFakeMobile 生成假手机号

func IP4toUint32

func IP4toUint32(ipAddr string) uint32

func Interface2Float64

func Interface2Float64(v interface{}) (fv float64, err error)

func InternalIP

func InternalIP() string

InternalIP get internal ip.

func IsChinese

func IsChinese(str string) bool

是否是中文

func IsPowerOfTwo

func IsPowerOfTwo(x int) bool

func JsonEncodeByte

func JsonEncodeByte(v interface{}, escapeHTML ...bool) []byte

func JsonMarshalByte

func JsonMarshalByte(v interface{}) []byte

func JsonMarshalString

func JsonMarshalString(v interface{}) string

func LocalIP

func LocalIP() string

func MD5

func MD5(src string) string

func NameOfFunction

func NameOfFunction(f interface{}) string

func RandStringN

func RandStringN(n int, source string) (str string)

从source里随机字符生成出长度为n的字符串

func S2b

func S2b(s string) []byte

字符串和byte互转 无copy 无垃圾回收

func SQLXFields

func SQLXFields(values interface{}) []string

func Uint32toIP4

func Uint32toIP4(ipInt uint32) string

IPv4 点分十进制与uint32的转换

func Wait

func Wait(timeout time.Duration)

控制台等待动画

Types

This section is empty.

Jump to

Keyboard shortcuts

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