pack

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2ToInt64

func Bytes2ToInt64(b []byte) int64

byte2 转 int64

func Bytes4ToInt64

func Bytes4ToInt64(b []byte) int64

byte4 转 int64

func Bytes8ToInt64

func Bytes8ToInt64(buf []byte) int64

byte8 转 int64

func DecHex

func DecHex(n int64) string

10进制 转 16进制

func HexDec

func HexDec(h string) (n int64)

16进制 转 10进制

func IntToBytes1

func IntToBytes1(n int64) []byte

int64 转 byte1

func IntToBytes2

func IntToBytes2(n int64) []byte

int64 转 byte2

func IntToBytes4

func IntToBytes4(n int64) []byte

int64 转 byte4

func IntToBytes8

func IntToBytes8(n int64) []byte

int64 转 byte8

Types

type Protocol

type Protocol struct {
	Format []string
}

func (*Protocol) DecToHexString

func (p *Protocol) DecToHexString(decString []byte) (responseStr string)

10进制转16进制字符串

func (*Protocol) HexStringToByte

func (p *Protocol) HexStringToByte(hexString string) (responseByte []byte)

16进制字符串转字节类型

func (*Protocol) Pack

func (p *Protocol) Pack(args ...int64) (ret []byte)

编码

func (*Protocol) Pack16

func (p *Protocol) Pack16(args ...int64) (hString string)

转成16进制编码字符串

func (*Protocol) UnPack

func (p *Protocol) UnPack(data []byte) []int64

解码

func (*Protocol) UnPack16

func (p *Protocol) UnPack16(hString string) (unIntList []int64)

解码16进制字符串

Jump to

Keyboard shortcuts

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