binary

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Jul 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.5.11

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

func BinaryTo added in v1.5.11

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

func BytesToMyStruct

func BytesToMyStruct(b []byte) unsafe.Pointer

func Int64To added in v1.5.11

func Int64To(i int64) []byte

func IntTo added in v1.5.11

func IntTo(i int) []byte

func StructToBytes

func StructToBytes(s interface{}) []byte

func ToB added in v1.5.11

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

func ToBinary added in v1.5.11

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

func ToInt added in v1.5.11

func ToInt(b []byte) int

func ToInt64 added in v1.5.11

func ToInt64(b []byte) int64

func ToUint added in v1.5.11

func ToUint(b []byte) uint64

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

func UintTo added in v1.5.11

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