tools

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 18 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToImage

func Base64ToImage(imageBase64 string) ([]byte, error)

func BigIntToETHBigFloat

func BigIntToETHBigFloat(f *big.Int) *big.Float

func BigIntToUsdtBigFloat

func BigIntToUsdtBigFloat(f *big.Int) *big.Float

func ChangeFloat2Float

func ChangeFloat2Float(f string, m int) string

精度处理

func ChangeInt2Float

func ChangeInt2Float(f string, m int) string

精度处理

func ChangeNumber

func ChangeNumber(f float64, m int) string

保留小数位

func CheckFloat

func CheckFloat(value string, decimal int) bool

小数点位数校验

func CompareHashAndPassword

func CompareHashAndPassword(e string, p string) (bool, error)

CompareHashAndPassword 比较hash

func Float2Int

func Float2Int(f float64, decimal int) uint64

浮点数精度处理转换整数

func Float2String

func Float2String(value string, decimal int) string

将字符串float进行精度处理

func GetDirFiles

func GetDirFiles(dir string) ([]string, error)

func GetGID

func GetGID() (n uint64, err error)

GetGID 获取当前协程id

func GetLocalNetDeviceNames

func GetLocalNetDeviceNames() (names []string, err error)

GetLocalNetDeviceNames 获取网卡名

func GetOrderid

func GetOrderid() string

func HexToBigInt

func HexToBigInt(hex string) *big.Int

func Hmac

func Hmac(data string) string

func IdsStrToIdsIntGroup

func IdsStrToIdsIntGroup(keys string) []int

func IsStringEmpty

func IsStringEmpty(str string) bool

func RemoveRepByMap

func RemoveRepByMap(slc []string) []string

slice去重

func Round

func Round(f float64, n int) float64

精度处理

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

结构体转为map

func SubByZero

func SubByZero(str string) string

截取字符串-将字符串前面的0去掉

func ToBigFloat

func ToBigFloat(str string) *big.Float

func ToHex

func ToHex(b []byte) string

Types

type ReplaceHelper

type ReplaceHelper struct {
	Root    string //路径
	OldText string //需要替换的文本
	NewText string //新的文本
}

func (*ReplaceHelper) DoWalk

func (h *ReplaceHelper) DoWalk() error

Jump to

Keyboard shortcuts

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