binaryencoding

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Magic = []byte{0x00, 0x61, 0x73, 0x6D}

Magic is the 4 byte preamble (literally "\0asm") of the binary format See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-magic

Functions

func EncodeFunctionSection

func EncodeFunctionSection(typeIndices []wasm.Index) []byte

EncodeFunctionSection encodes a wasm.SectionIDFunction for the type indices associated with module-defined functions in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#function-section%E2%91%A0

func EncodeFunctionType

func EncodeFunctionType(t *wasm.FunctionType) []byte

EncodeFunctionType returns the wasm.FunctionType encoded in WebAssembly 1.0 (20191205) Binary Format.

Note: Function types are encoded by the byte 0x60 followed by the respective vectors of parameter and result types. See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#function-types%E2%91%A4

func EncodeImport

func EncodeImport(i *wasm.Import) []byte

EncodeImport returns the wasm.Import encoded in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-import

func EncodeLimitsType

func EncodeLimitsType(min uint64, max *uint64, shared, index64 bool) []byte

EncodeLimitsType returns the `limitsType` (min, max) encoded in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#limits%E2%91%A6

Extended in threads proposal: https://webassembly.github.io/threads/core/binary/types.html#limits Extended in memory64 proposal: https://webassembly.github.io/memory64/core/binary/types.html#limits

func EncodeMemory

func EncodeMemory(i *wasm.Memory) []byte

EncodeMemory returns the wasm.Memory encoded in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-memory

func EncodeModule

func EncodeModule(m *wasm.Module) (bytes []byte)

EncodeModule implements wasm.EncodeModule for the WebAssembly 1.0 (20191205) Binary Format. Note: If saving to a file, the conventional extension is wasm See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-format%E2%91%A0

func EncodeNameSectionData

func EncodeNameSectionData(n *wasm.NameSection) (data []byte)

EncodeNameSectionData serializes the data for the "name" key in wasm.SectionIDCustom according to the standard:

Note: The result can be nil because this does not encode empty subsections

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-namesec

func EncodeStartSection

func EncodeStartSection(funcidx wasm.Index) []byte

EncodeStartSection encodes a wasm.SectionIDStart for the given function index in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#start-section%E2%91%A0

func EncodeTable

func EncodeTable(i *wasm.Table) []byte

EncodeTable returns the wasm.Table encoded in WebAssembly 1.0 (20191205) Binary Format.

See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-table

func EncodeValTypes

func EncodeValTypes(vt []wasm.ValueType) []byte

EncodeValTypes fast paths binary encoding of common value type lengths

Types

This section is empty.

Jump to

Keyboard shortcuts

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