Documentation ¶
Index ¶
- Constants
- func ArrayReverse(b []byte) []byte
- func ConvertBigIntegerToBytes(data *big.Int) []byte
- func ConvertBytesToBigInteger(ba []byte) *big.Int
- func RandUint32(min, max int) uint32
- func RandomInt(min, max int) int
- func RandomString(n int) string
- func ReadVarBytes(r io.Reader) ([]byte, error)
- func ReadVarString(r io.Reader) (string, error)
- func ReadVarUint(r io.Reader) uint64
- func WriteVarBytes(w io.Writer, b []byte) error
- func WriteVarString(w io.Writer, s string) error
- func WriteVarUint(w io.Writer, val uint64) error
- type Address
- type Fixed8
- type Uint160
- type Uint256
Constants ¶
const ADDR_LEN = 20
Variables ¶
This section is empty.
Functions ¶
func ArrayReverse ¶
ArrayReverse return a reversed version of the given byte slice.
func RandUint32 ¶
RandUint32 return a random number between min and max.
func RandomString ¶
RandomString returns a random string with the n as its length.
func ReadVarBytes ¶
ReadVarBytes reads a variable length byte array.
func ReadVarString ¶
ReadVarString reads a variable length string.
func ReadVarUint ¶
ReadVarUint reads a variable unsigned integer and returns it as a uint64.
func WriteVarBytes ¶
WriteVarBytes writes a variable length byte array.
func WriteVarString ¶
WriteVarString writes a variable length string.
Types ¶
type Address ¶
func AddressFromBase58 ¶
AddressFromBase58 returns Address from encoded base58 string
func AddressParseFromBytes ¶
AddressParseFromBytes returns parsed Address
func (*Address) Deserialize ¶
Deserialize deserialize Address from io.Reader
func (*Address) ToHexString ¶
ToHexString returns hex string representation of Address
type Fixed8 ¶
type Fixed8 int64
Fixed8 represents a fixed-point number with precision 10^-8.
func Fixed8DecodeString ¶
Fixed8DecodeString parses s which must be a fixed point number with precision up to 10^-8
func (*Fixed8) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type Uint160 ¶
type Uint160 [uint160Size]uint8
Uint160 is a 20 byte long unsigned integer.
func Uint160DecodeBytes ¶
Uint160DecodeBytes attempts to decode the given bytes into an Uint160.
func Uint160DecodeString ¶
Uint160DecodeString attempts to decode the given string into an Uint160.
func Uint160FromScript ¶
Uint160FromScript returns a Uint160 type from a raw script.
func (Uint160) BytesReverse ¶
BytesReverse return a reversed byte representation of u.
func (Uint160) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (*Uint160) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type Uint256 ¶
type Uint256 [uint256Size]uint8
Uint256 is a 32 byte long unsigned integer.
func Read2000Uint256Hashes ¶
Read2000Uint256Hashes attempt to read 2000 Uint256 hashes from the given byte array.
func Uint256DecodeBytes ¶
Uint256DecodeBytes attempts to decode the given string into an Uint256.
func Uint256DecodeString ¶
Uint256DecodeString attempts to decode the given string into an Uint256.
func (Uint256) BytesReverse ¶
BytesReverse return a reversed byte representation of u.
func (Uint256) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (*Uint256) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.