Documentation ¶
Index ¶
- func AppendSleb128(b []byte, v int64) []byte
- func AppendUleb128(b []byte, v uint64) []byte
- func FromBigInt(n *big.Int) (out []byte)
- func FromUInt64(n uint64) (out []byte)
- func Sleb128FromInt64(v int64) []byte
- func Sleb128ToInt64(b []byte) (s int64, n uint8)
- func ToBigInt(encoded []byte) *big.Int
- func ToUInt64(encoded []byte) uint64
- func Uleb128FromInt64(v int64) []byte
- func Uleb128ToUint64(b []byte) (u uint64, n uint8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSleb128 ¶
AppendSleb128 appends v to b using DWARF's signed LEB128 encoding.
func AppendUleb128 ¶
AppendUleb128 appends v to b using DWARF's unsigned LEB128 encoding.
func FromBigInt ¶
FromBigInt encodes the signed big integer n in two's complement, LEB128-encodes it, and returns the encoded bytes.
func FromUInt64 ¶
FromUInt64 encodes n with LEB128 and returns the encoded bytes.
func Sleb128FromInt64 ¶
Sleb128FromInt64 encode int64 v to []byte using signed LEB128 encoding.
func Sleb128ToInt64 ¶
Sleb128ToInt64 decodes b to s with signed LEB128 encoding and returns the number of bytes read. On error (bad encoded b), n will be 0 and therefore s must not be trusted.
func ToUInt64 ¶
TODO, not check the input overflow ToUInt64 decodes LEB128-encoded bytes into a uint64.
func Uleb128FromInt64 ¶
Uleb128FromInt64 encode int64 v to []byte using unsigned LEB128 encoding.
func Uleb128ToUint64 ¶
Uleb128ToUint64 decodes b to u with unsigned LEB128 encoding and returns the number of bytes read. On error (bad encoded b), n will be 0 and therefore u must not be trusted.
Types ¶
This section is empty.