sutil

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeFileMd5

func ComputeFileMd5(filePath string) (string, error)

func GetInvalidUtf8String

func GetInvalidUtf8String(s string, num int) (string, int)

截取获取合法 num 个unicode字符 的utf8字符串 num 为0,全部截取 返回截取的unicode字符个数,以及字符串

func GetUUID

func GetUUID() string

func GetUniqueMd5

func GetUniqueMd5() string

func GetUtf8Chars

func GetUtf8Chars(s string, num int) string

func GetUtf8Chars_old

func GetUtf8Chars_old(s string, num int) string

func HashV

func HashV(addrs []string, key string) string

func IsJSON

func IsJSON(s []byte) bool

func JsonBigInt64Decode

func JsonBigInt64Decode(s []byte, v interface{}) (err error)

func Round

func Round(val float64, deci int) float64

四舍五入

func WriteFile

func WriteFile(path string, data []byte, perm os.FileMode) error

文件输出,目录不存在自动创建

Types

type VersionCmp

type VersionCmp struct {
	// contains filtered or unexported fields
}

func NewVersionCmp

func NewVersionCmp(ver string) *VersionCmp

func (*VersionCmp) Eq

func (m *VersionCmp) Eq(ver string) bool

func (*VersionCmp) Gt

func (m *VersionCmp) Gt(ver string) bool

func (*VersionCmp) Gte

func (m *VersionCmp) Gte(ver string) bool

func (*VersionCmp) Lt

func (m *VersionCmp) Lt(ver string) bool

func (*VersionCmp) Lte

func (m *VersionCmp) Lte(ver string) bool

func (*VersionCmp) Max

func (m *VersionCmp) Max() string

func (*VersionCmp) Min

func (m *VersionCmp) Min() string

func (*VersionCmp) Ne

func (m *VersionCmp) Ne(ver string) bool

Directories

Path Synopsis
pb
bak
tst
tst

Jump to

Keyboard shortcuts

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