Documentation ¶
Overview ¶
Package bytes offers convenience functions to convert bytes to and from unsigned integers, respecting a defined byte-order.
The underlying byte order and conversion methods being used stem from the encoding/binary package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Endian defines the byte order used for the encoding. Endian binary.ByteOrder = binary.BigEndian // ErrInvalidLen is an error indicating that a byte slice had invalid length // for the conversion that should have been performed. ErrInvalidLen = errors.New("invalid byte length") )
Functions ¶
func FromUint16 ¶
FromUint16 converts an uint16 to a byte slice.
func FromUint32 ¶
FromUint32 converts an uint32 to a byte slice.
func FromUint64 ¶
FromUint64 converts an uint64 to a byte slice.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.