Documentation ¶
Overview ¶
Package bits provides functions for common bit operations
Index ¶
- func BytesToUint32(bytes []byte) uint32
- func GetBits(source uint64, upperBound int, lowerBound int) uint64
- func Is32BitSignExt(val uint64) (ret bool)
- func SignExt(in uint64, signBit int) (out uint64)
- func Uint16ByteArray(val uint16) [8]byte
- func Uint32ByteArray(val uint32) [8]byte
- func Uint64ByteArray(val uint64) [8]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUint32 ¶
BytesToUint32 converts a byte slice to a uint32.
func GetBits ¶
GetBits returns the bits within the provided bounds (inclusive). The requested bits are shifted to the LSB.
func Is32BitSignExt ¶
Is32BitSignExt returns true if the 64-bit value is a sign extended 32-bit value.
func Uint16ByteArray ¶
Uint16ByteArray converts a uint16 to an array of bytes.
The length is determined by the transaction length with memory stores.
func Uint32ByteArray ¶
Uint32ByteArray converts a uint32 to an array of bytes.
The length is determined by the transaction length with memory stores.
func Uint64ByteArray ¶
Uint64ByteArray converts a uint64 to an array of bytes.
The length is determined by the transaction length with memory stores.
Types ¶
This section is empty.