gbytes

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From[T constraints.Integer](val T, width ...int) []byte

func FromFloat

func FromFloat[T constraints.Float](val T, width ...int) []byte

func FromHex

func FromHex(val string, sep ...string) []byte

func Get

func Get[T constraints.Integer](data []byte, offset int, width int) (res T, off int)

func Get2

func Get2[T constraints.Integer](data []byte, offset int, width int) T

func Random

func Random(size int) (res []byte)

func Random2

func Random2(size int, max ...int) (res []byte)

func Set

func Set[T constraints.Integer](data []byte, offset int, value T, width int) int

func SetByte

func SetByte[T constraints.Integer](data []byte, offset int, value T) int

func SetDword

func SetDword[T constraints.Integer](data []byte, offset int, value T) int

func SetQword

func SetQword[T constraints.Integer](data []byte, offset int, value T) int

func SetWord

func SetWord[T constraints.Integer](data []byte, offset int, value T) int

func TryFrom

func TryFrom[T constraints.Integer](val T, width ...int) (res []byte, err error)

func TryFromFloat

func TryFromFloat[T constraints.Float](val T, width ...int) (res []byte, err error)

func TryFromHex

func TryFromHex(val string, sep ...string) ([]byte, error)

func TryGet

func TryGet[T constraints.Integer](data []byte, offset int, width int) (res T, off int, err error)

func TryGet2

func TryGet2[T constraints.Integer](data []byte, offset int, width int) (res T, err error)

func TrySet

func TrySet[T constraints.Integer](data []byte, offset int, value T, width int) (int, error)

func Width

func Width[T constraints.Integer](val T) int

func Width2

func Width2[T constraints.Integer | constraints.Float](val T) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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