binary

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: OSL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Simple translation between numbers and byte sequences.

Why not use existing packages? These are not big-endian:

encoding/binary#Uvarint
encoding/binary#Varint

These read a fixed number of bytes:

x/crypto/cryptobyte#String.ReadUint8
x/crypto/cryptobyte#String.ReadUint16
x/crypto/cryptobyte#String.ReadUint32

These panic if buffer is short:

encoding/binary#ByteOrder.Uint16
encoding/binary#ByteOrder.Uint32
encoding/binary#ByteOrder.Uint64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uint16

func Uint16(buf []byte) (uint16, bool)

func Uint32 added in v1.5.2

func Uint32(buf []byte) (uint32, bool)

func Uint64 added in v1.5.2

func Uint64(buf []byte) (uint64, bool)

func UintN added in v1.5.2

func UintN(buf []byte, n int) (uint64, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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