utility

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bin2GBKString

func Bin2GBKString(b []byte) (string, error)

func Bin2HexString

func Bin2HexString(binData []byte) string

Bin2HexString 字节数组转16进制字符串

func Bin2String

func Bin2String(b []byte) string

Bin2String 字节数组转asc字符串

func Bin2Uint16

func Bin2Uint16(binData []byte) uint16

Bin2Uint16 字节数组转Uint16 大端

func Bin2Uint32_BigEndian

func Bin2Uint32_BigEndian(binData []byte) uint32

Bin2Uint32_BigEndian 字节数组转Uint32 大端

func Bin2Uint32_LittleEndian

func Bin2Uint32_LittleEndian(binData []byte) uint32

Bin2Uint32_LittleEndian 字节数组转Uint32 小端

func Bin2Uint64

func Bin2Uint64(binData []byte) uint64

Bin2Uint64 字节数组转Uint64 大端

func ByteSliceEqual

func ByteSliceEqual(a, b []byte) bool

ByteSliceEqual byte切片是否相等

func GBKString2Bin

func GBKString2Bin(s string) ([]byte, error)

func HexString2Bin

func HexString2Bin(strData string) []byte

HexString2Bin 16进制字符串转字节数组

func IntToString

func IntToString(n64 int64, radix int) string

IntToString Uint64转字符串 大端

func String2Bin

func String2Bin(s string) []byte

String2Bin asc字符串转字节数组

func StringPadLeft

func StringPadLeft(src string, paddingChar string, expc int) string

StringPadLeft 左补齐

func StringPadRight

func StringPadRight(src string, paddingChar string, expc int) string

StringPadRight 右补齐

func StringTruncRigth

func StringTruncRigth(s string, l int, pad byte) string

func Uint16ToBin

func Uint16ToBin(v uint16) []byte

Uint16ToBin Uint16转字节数组 大端

func Uint32ToBin_BigEndian

func Uint32ToBin_BigEndian(v uint32) []byte

Uint32ToBin_BigEndian Uint32转字节数组 大端

func Uint32ToBin_LittleEndian

func Uint32ToBin_LittleEndian(v uint32) []byte

Uint32ToBin_LittleEndian Uint32转字节数组 小端

func Uint64ToBin

func Uint64ToBin(v uint64) []byte

Uint64ToBin Uint64转字节数组 大端

Types

This section is empty.

Jump to

Keyboard shortcuts

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