binary

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BTo added in v1.7.2

func BTo[T constraints.Integer](b []byte) T

func BinaryTo added in v1.7.2

func BinaryTo[T constraints.Integer](b []byte) T

func BytesToMyStruct

func BytesToMyStruct(b []byte) unsafe.Pointer

func Int64To added in v1.7.2

func Int64To(i int64) []byte

func IntTo added in v1.7.2

func IntTo(i int) []byte

func StructToBytes

func StructToBytes(s interface{}) []byte

func ToB added in v1.7.2

func ToB[T constraints.Integer](v T) []byte

func ToBinary added in v1.7.2

func ToBinary[T constraints.Integer](v T) []byte

func ToInt added in v1.7.2

func ToInt(b []byte) int

func ToInt64 added in v1.7.2

func ToInt64(b []byte) int64

func ToUint added in v1.7.2

func ToUint(b []byte) uint64

比标准库慢很多,10倍左右,string和bytes互转只是节省复制内存,unsafe操作有很多检测 binary.LittleEndian.Uint64(b)

func UintTo added in v1.7.2

func UintTo(i uint64) []byte

binary.LittleEndian.PutUint64(b)

Types

This section is empty.

Jump to

Keyboard shortcuts

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