binary

package
v0.0.0-...-0a7ba41 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUUID

func AppendUUID(dst []byte, uuid []byte) []byte

func CalculateImageResourceId

func CalculateImageResourceId(md5 []byte) string

func GZipCompress

func GZipCompress(data []byte) []byte

func GZipUncompress

func GZipUncompress(src []byte) []byte

func GenUUID

func GenUUID(uuid []byte) []byte

func NewWriterF

func NewWriterF(f func(writer *Writer)) []byte

func ToBytes

func ToBytes(i interface{}) []byte

func ToChunkedBytesF

func ToChunkedBytesF(b []byte, size int, f func([]byte))

func ToIPV4Address

func ToIPV4Address(arr []byte) string

func UInt32ToIPV4Address

func UInt32ToIPV4Address(i uint32) string

func ZlibCompress

func ZlibCompress(data []byte) []byte

func ZlibUncompress

func ZlibUncompress(src []byte) []byte

Types

type NetworkReader

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

func NewNetworkReader

func NewNetworkReader(conn net.Conn) *NetworkReader

func (*NetworkReader) ReadByte

func (r *NetworkReader) ReadByte() (byte, error)

func (*NetworkReader) ReadBytes

func (r *NetworkReader) ReadBytes(len int) ([]byte, error)

func (*NetworkReader) ReadInt32

func (r *NetworkReader) ReadInt32() (int32, error)

type Reader

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

func NewReader

func NewReader(data []byte) *Reader

func (*Reader) Len

func (r *Reader) Len() int

func (*Reader) ReadAvailable

func (r *Reader) ReadAvailable() []byte

func (*Reader) ReadByte

func (r *Reader) ReadByte() byte

func (*Reader) ReadBytes

func (r *Reader) ReadBytes(len int) []byte

func (*Reader) ReadBytesShort

func (r *Reader) ReadBytesShort() []byte

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() int32

func (*Reader) ReadString

func (r *Reader) ReadString() string

func (*Reader) ReadStringLimit

func (r *Reader) ReadStringLimit(limit int) string

func (*Reader) ReadStringShort

func (r *Reader) ReadStringShort() string

func (*Reader) ReadTlvMap

func (r *Reader) ReadTlvMap(tagSize int) (m TlvMap)

func (*Reader) ReadUInt16

func (r *Reader) ReadUInt16() uint16

type TEA

type TEA [4]uint32

func NewTeaCipher

func NewTeaCipher(key []byte) *TEA

func (*TEA) Decrypt

func (t *TEA) Decrypt(data []byte) []byte

func (*TEA) Encrypt

func (t *TEA) Encrypt(src []byte) (dst []byte)

http://bbs.chinaunix.net/thread-583468-1-1.html 感谢xichen大佬对TEA的解释

type TlvMap

type TlvMap map[uint16][]byte

func (TlvMap) Exists

func (tlv TlvMap) Exists(key uint16) bool

type Writer

type Writer bytes.Buffer

func NewWriter

func NewWriter() *Writer

func (*Writer) Bytes

func (w *Writer) Bytes() []byte

func (*Writer) EncryptAndWrite

func (w *Writer) EncryptAndWrite(key []byte, data []byte)

func (*Writer) Write

func (w *Writer) Write(b []byte)

func (*Writer) WriteBool

func (w *Writer) WriteBool(b bool)

func (*Writer) WriteByte

func (w *Writer) WriteByte(b byte)

func (*Writer) WriteIntLvPacket

func (w *Writer) WriteIntLvPacket(offset int, f func(writer *Writer))

func (*Writer) WriteString

func (w *Writer) WriteString(v string)

func (*Writer) WriteStringShort

func (w *Writer) WriteStringShort(v string)

func (*Writer) WriteTlv

func (w *Writer) WriteTlv(data []byte)

func (*Writer) WriteTlvLimitedSize

func (w *Writer) WriteTlvLimitedSize(data []byte, limit int)

func (*Writer) WriteUInt16

func (w *Writer) WriteUInt16(v uint16)

func (*Writer) WriteUInt32

func (w *Writer) WriteUInt32(v uint32)

func (*Writer) WriteUInt64

func (w *Writer) WriteUInt64(v uint64)

func (*Writer) WriteUniPacket

func (w *Writer) WriteUniPacket(commandName string, sessionId, extraData, body []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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