Documentation ¶
Index ¶
- func Read256(r *bytes.Buffer, b []byte) error
- func Read512(r *bytes.Buffer, b []byte) error
- func ReadBLS(r *bytes.Buffer, b []byte) error
- func ReadBLSPKey(r *bytes.Buffer, b []byte) error
- func ReadBool(r *bytes.Buffer, b *bool) error
- func ReadString(r *bytes.Buffer) (string, error)
- func ReadUint16LE(r *bytes.Buffer, v *uint16) error
- func ReadUint32LE(r *bytes.Buffer, v *uint32) error
- func ReadUint64LE(r *bytes.Buffer, v *uint64) error
- func ReadUint8(r *bytes.Buffer, v *uint8) error
- func ReadVarBytes(r *bytes.Buffer, b *[]byte) error
- func ReadVarBytesUint32LE(r *bytes.Buffer, b *[]byte) error
- func ReadVarInt(r *bytes.Buffer) (uint64, error)
- func VarIntEncodeSize(v uint64) uint64
- func Write256(w *bytes.Buffer, b []byte) error
- func Write512(w *bytes.Buffer, b []byte) error
- func WriteBLS(w *bytes.Buffer, b []byte) error
- func WriteBLSPKey(w *bytes.Buffer, b []byte) error
- func WriteBool(w *bytes.Buffer, b bool) error
- func WriteString(w *bytes.Buffer, s string) error
- func WriteUint16LE(w *bytes.Buffer, v uint16) error
- func WriteUint32LE(w *bytes.Buffer, v uint32) error
- func WriteUint64LE(w *bytes.Buffer, v uint64) error
- func WriteUint8(w *bytes.Buffer, v uint8) error
- func WriteVarBytes(w *bytes.Buffer, b []byte) error
- func WriteVarBytesUint32(w *bytes.Buffer, b []byte) error
- func WriteVarInt(w *bytes.Buffer, v uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBLS ¶
ReadBLS will read a compressed bls signature (33 bytes) from r and return it as a slice of bytes.
func ReadBLSPKey ¶ added in v0.6.0
ReadBLSPKey will read a compressed bls public key (96 bytes) from r and return it as a slice of bytes.
func ReadString ¶
ReadString reads the data with ReadVarBytes and returns it as a string by simple type conversion.
func ReadUint16LE ¶ added in v0.2.0
ReadUint16LE will read two bytes and convert them to a uint16 assuming little-endian byte order. The result is put into v.
func ReadUint32LE ¶ added in v0.2.0
ReadUint32LE will read four bytes and convert them to a uint32 assuming little-endian byte order. The result is put into v.
func ReadUint64LE ¶ added in v0.2.0
ReadUint64LE will read eight bytes and convert them to a uint64 assuming little-endian byte order. The result is put into v.
func ReadVarBytes ¶
ReadVarBytes will read a CompactSize int denoting the length, then proceeds to read that amount of bytes from r into b.
func ReadVarBytesUint32LE ¶ added in v0.5.0
ReadVarBytesUint32LE will read a CompactSize int denoting the length, then proceeds to read that amount of bytes from r into b.
func ReadVarInt ¶
ReadVarInt reads the discriminator byte of a CompactSize int, and then deserializes the number accordingly.
func VarIntEncodeSize ¶
VarIntEncodeSize returns the number of bytes needed to serialize a CompactSize int of size v.
func WriteBLSPKey ¶ added in v0.6.0
WriteBLSPKey will write a compressed bls public key (96 bytes) to w.
func WriteString ¶
WriteString will write string s as a slice of bytes through WriteVarBytes.
func WriteUint16LE ¶ added in v0.2.0
WriteUint16LE will write two bytes in little-endian byte order.
func WriteUint32LE ¶ added in v0.2.0
WriteUint32LE will write four bytes in little-endian byte order.
func WriteUint64LE ¶ added in v0.2.0
WriteUint64LE will write eight bytes in little-endian byte order.
func WriteUint8 ¶
WriteUint8 will write a single byte.
func WriteVarBytes ¶
WriteVarBytes will serialize a CompactSize int denoting the length, then proceeds to write b into w.
func WriteVarBytesUint32 ¶ added in v0.5.0
WriteVarBytesUint32 will serialize a CompactSize int denoting the length, then proceeds to write b into w.
Types ¶
This section is empty.