leb128

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInt32

func DecodeInt32(r io.ByteReader) (ret int32, bytesRead uint64, err error)

func DecodeInt33AsInt64

func DecodeInt33AsInt64(r io.ByteReader) (ret int64, bytesRead uint64, err error)

DecodeInt33AsInt64 is a special cased decoder for wasm.BlockType which is encoded as a positive signed integer, yet still needs to fit the 32-bit range of allowed indices. Hence, this is 33, not 32-bit!

See https://webassembly.github.io/spec/core/binary/instructions.html#control-instructions

func DecodeInt64

func DecodeInt64(r io.ByteReader) (ret int64, bytesRead uint64, err error)

func DecodeUint32

func DecodeUint32(r io.ByteReader) (ret uint32, bytesRead uint64, err error)

func EncodeInt32

func EncodeInt32(value int32) []byte

EncodeInt32 encodes the signed value into a buffer in LEB128 format

See https://en.wikipedia.org/wiki/LEB128#Encode_signed_integer

func EncodeInt64

func EncodeInt64(value int64) (buf []byte)

EncodeInt64 encodes the signed value into a buffer in LEB128 format

See https://en.wikipedia.org/wiki/LEB128#Encode_signed_integer

func EncodeUint32

func EncodeUint32(value uint32) []byte

EncodeUint32 encodes the value into a buffer in LEB128 format

See https://en.wikipedia.org/wiki/LEB128#Encode_unsigned_integer

func EncodeUint64

func EncodeUint64(value uint64) (buf []byte)

EncodeUint64 encodes the value into a buffer in LEB128 format

See https://en.wikipedia.org/wiki/LEB128#Encode_unsigned_integer

func LoadInt32

func LoadInt32(buf []byte) (ret int32, bytesRead uint64, err error)

func LoadInt64

func LoadInt64(buf []byte) (ret int64, bytesRead uint64, err error)

func LoadUint32

func LoadUint32(buf []byte) (ret uint32, bytesRead uint64, err error)

func LoadUint64

func LoadUint64(buf []byte) (ret uint64, bytesRead uint64, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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