utils

package
v0.0.0-...-3249af5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UTF8    = string("UTF-8")
	GB18030 = string("GB18030")
)

Variables

This section is empty.

Functions

func BitsFromByte

func BitsFromByte(b byte) []byte

BitsFromByte byte 转 bits

func CheckNum

func CheckNum(data []byte) int

CheckNum 校验和

func ConvertByte2String

func ConvertByte2String(byte []byte, charset string) string

ConvertByte2String 字符转码

func ConvertToBin

func ConvertToBin(num int) string

ConvertToBin 将十进制数字转化为二进制字符串

func DateBytes

func DateBytes() []byte

DateBytes 获取 年月日、时分秒

func GetFreePort

func GetFreePort() (int, error)

func GetLocalIp

func GetLocalIp() (string, error)

func Hex2Dec

func Hex2Dec(val string) int

Hex2Dec 二进制转十进制

func IntToBytes

func IntToBytes(n int) []byte

IntToBytes 整形转换成字节

func Reverse

func Reverse(arr *[]string)

Reverse 数组倒序函数

func Str2DEC

func Str2DEC(s string) (num int)

Str2DEC 字符串转十进制

func Struct2Map

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

Struct2Map 结构体转map

func StructToString

func StructToString(v interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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