binary

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package binary implements WebAssembly integer decoding.

The Reader interface is overly specific as a performance optimization; see https://savo.la/sneaky-go-interface-conversion.html for background.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uint32

func Uint32(r Reader) (uint32, int, error)

Uint32 reads a little-endian value. The number of bytes read is also returned (4 if successful).

func Uint64

func Uint64(r Reader) (uint64, int, error)

Uint64 reads a little-endian value. The number of bytes read is also returned (8 if successful).

func Varint32

func Varint32(r Reader) (int32, int, error)

Varint32 reads variably encoded value. The number of bytes read is also returned.

func Varint64

func Varint64(r Reader) (int64, int, error)

Varint64 reads variably encoded value. The number of bytes read is also returned.

func Varint7

func Varint7(r Reader) (int8, int, error)

Varint7 reads a byte using the variable-length encoding for signed integers. The number of bytes read is also returned (0 or 1).

func Varuint1

func Varuint1(r Reader) (bool, int, error)

Varuint1 reads a bit (in a byte). The number of bytes read is also returned (0 or 1).

func Varuint32

func Varuint32(r Reader) (uint32, int, error)

Varuint32 reads variably encoded value. The number of bytes read is also returned (up to 5).

func Varuint64

func Varuint64(r Reader) (uint64, int, error)

Varuint64 reads variably encoded value. The number of bytes read is also returned (up to 10).

Types

type Reader

type Reader interface {
	io.Reader
	io.ByteScanner
}

Reader is appropriate for decoding WebAssembly modules.

Jump to

Keyboard shortcuts

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