Documentation
¶
Index ¶
- func Bcd2Number(bcd []byte) string
- func Bytes2String(b []byte) string
- func CompareVersion(src, dst string) int
- func Constains(str string, sub string) bool
- func Decoder2Json(str string, v interface{}) error
- func Empty(str string) bool
- func FillZero(sl []string, i int) []string
- func FmtSlice(f, space string, args ...interface{}) string
- func FmtSliceByDefault(args ...interface{}) string
- func GetRandomString(l int) string
- func Hash(v interface{}) (uint64, error)
- func Hex2Byte(str string) []byte
- func Hex2Str(b []byte) string
- func IsArray(data []byte) (bool, error)
- func Md5(str string) string
- func MustHash(v interface{}) uint64
- func Number2bcd(number string) []byte
- func ObjByAnchor(str, anchor string) interface{}
- func Parse(str string, v interface{}) error
- func ParseByBytes(bytes []byte, v interface{}) error
- func ParseFromYaml(str string, v interface{}) error
- func RandStringBytesMaskImpr(n int) []byte
- func RandomString(l int) string
- func String2Bytes(s string) []byte
- func ToAscii(str string) string
- func ToBytes(obj interface{}) []byte
- func ToJsonStr(obj interface{}) string
- func ToStr(value interface{}) string
- func TrimSpace(str string) string
- func UnsafeEqual(a string, b []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bcd2Number ¶
func Bytes2String ¶
Bytes2String 直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。
func CompareVersion ¶
CompareVersion 版本比较, src > dst 返回 1 src = dst 返回 0 src < dst 返回 -1
func FmtSliceByDefault ¶
func FmtSliceByDefault(args ...interface{}) string
func Hash ¶
Hash returns the xxhash of an arbitrary value or struct. NOT SUITABLE FOR CRYTOGRAPHIC HASHING.
func MustHash ¶
func MustHash(v interface{}) uint64
MustHash returns the xxhash of an arbitrary value or struct. Returns 0 on error. NOT SUITABLE FOR CRYTOGRAPHIC HASHING.
func Number2bcd ¶
func ObjByAnchor ¶
func ObjByAnchor(str, anchor string) interface{}
func ParseByBytes ¶
func ParseFromYaml ¶
func RandStringBytesMaskImpr ¶
RandStringBytesMaskImpr 生成指定长度的随机字符串
func String2Bytes ¶
String2Bytes 直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。 转换之后若没做其他操作直接改变里面的字符,则程序会崩溃。 如 b:=String2bytes("xxx"); b[1]='d'; 程序将panic。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.