binary

package
v1.5.2 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:

encoding/binary#ByteOrder.Uint16
encoding/binary#ByteOrder.Uint32
encoding/binary#ByteOrder.Uint64
x/crypto/cryptobyte#String.ReadUint8
x/crypto/cryptobyte#String.ReadUint16
x/crypto/cryptobyte#String.ReadUint32

Index

Constants

This section is empty.

Variables

View Source
var (
	Uint16 = binary.BigEndian.Uint16
	Uint32 = binary.BigEndian.Uint32
	Uint64 = binary.BigEndian.Uint64
)

Functions

func IntN added in v1.5.2

func IntN(buf []byte, n int) int64

func UintN added in v1.5.2

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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