numbers

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUint

func BytesToUint(in []byte) (uint64, error)

BytesToUint convers a number of bytes into a uint64 The allowed in lengths are:

2: for a uint16 encoded as uint64
4: for a uint32 encoded as uint64
8: for a uint64

func UintToBytes

func UintToBytes(in uint64, size uint8) []byte

UintToBytes converst a uint64 into a number of bytes The size param defines the size of the output buffer The allowed sizes are:

16: converts the in to uint16 and returns a 2 byte buffer
32: converts the in to uint32 and returns a 4 byte buffer
64: returns a 8 byte buffer

Types

This section is empty.

Jump to

Keyboard shortcuts

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