Documentation ¶
Index ¶
- func ReadElement(r io.Reader, order binary.ByteOrder, element interface{}) error
- func ReadVarBytes(r io.Reader, order binary.ByteOrder) ([]byte, error)
- func ReadVarInt(r io.Reader, order binary.ByteOrder) (uint64, error)
- func WriteElement(w io.Writer, order binary.ByteOrder, element interface{}) error
- func WriteElements(w io.Writer, order binary.ByteOrder, elements ...interface{}) error
- func WriteHexString(w io.Writer, order binary.ByteOrder, str string) error
- func WritePrefixedBytes(w io.Writer, order binary.ByteOrder, bytes []byte) error
- func WritePrefixedHexString(w io.Writer, order binary.ByteOrder, str string) error
- func WriteReversedHexString(w io.Writer, order binary.ByteOrder, str string) error
- func WriteSerializedNumber(w io.Writer, order binary.ByteOrder, val uint64) error
- func WriteVarByteArray(w io.Writer, order binary.ByteOrder, byteArray [][]byte) error
- func WriteVarBytes(w io.Writer, order binary.ByteOrder, bytes []byte) error
- func WriteVarHexString(w io.Writer, order binary.ByteOrder, str string) error
- func WriteVarInt(w io.Writer, order binary.ByteOrder, val uint64) error
- func WriteVarString(w io.Writer, order binary.ByteOrder, str string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadVarBytes ¶
ReadVarBytes reads the initial varInt and reads the following length of bytes.
func ReadVarInt ¶
ReadVarInt reads a variable length integer from r and returns it as a uint64.
func WriteElement ¶
writeElement writes the little endian representation of element to w.
func WriteElements ¶
writeElements writes multiple items to w. It is equivalent to multiple calls to writeElement.
func WriteHexString ¶
WriteHexString decodes a hex string and writes the decoded bytes.
func WritePrefixedBytes ¶
WritePrefixedBytes serializes a variable length byte array to w as an int containing the number of bytes, followed by the bytes themselves.
func WritePrefixedHexString ¶
WriteVarHexString decodes a hex string and writes the decoded bytes as PrefixedBytes.
func WriteReversedHexString ¶
WriteHexString decodes a hex string and writes the decoded bytes in reversed byte order.
func WriteSerializedNumber ¶
Special helper for Firo coinbase
func WriteVarByteArray ¶
func WriteVarBytes ¶
WriteVarBytes serializes a variable length byte array to w as a varInt containing the number of bytes, followed by the bytes themselves.
func WriteVarHexString ¶
WriteVarHexString decodes a hex string and writes the decoded bytes as VarBytes.
func WriteVarInt ¶
WriteVarInt serializes val to w using a variable number of bytes depending on its value.
Types ¶
This section is empty.