binary

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT, Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAny added in v1.6.0

func FromAny(s any) []byte

func FromInt added in v1.6.0

func FromInt(i int) []byte

func FromInt64 added in v1.6.0

func FromInt64(i int64) []byte

func FromInteger added in v1.6.0

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

func FromUint added in v1.6.0

func FromUint(i uint64) []byte

binary.LittleEndian.PutUint64(b)

func Int added in v1.6.0

func Int(b []byte) int

func Int64 added in v1.6.0

func Int64(b []byte) int64

func Integer added in v1.6.0

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

func Uint added in v1.6.0

func Uint(b []byte) uint64

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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