common

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const UINT168SIZE = 21

This is a magical change of Uint168, with length from 20 to 21. In fact, It is UINT168 now.

View Source
const UINT256SIZE int = 32

Variables

This section is empty.

Functions

func BytesReverse

func BytesReverse(u []byte) []byte

func BytesToHexString

func BytesToHexString(data []byte) string

func CompareHeight

func CompareHeight(blockHeight uint64, heights []uint64) bool

func GetUint16Array

func GetUint16Array(source []byte) ([]uint16, error)

func HexStringToBytes

func HexStringToBytes(value string) ([]byte, error)

func HexStringToBytesReverse

func HexStringToBytesReverse(value string) ([]byte, error)

func ToByteArray

func ToByteArray(source []uint16) []byte

Types

type Fixed64

type Fixed64 int64

the 64 bit fixed-point number, precise 10^-8

func (*Fixed64) Deserialize

func (f *Fixed64) Deserialize(r io.Reader) error

func (Fixed64) GetData

func (f Fixed64) GetData() int64

func (*Fixed64) Serialize

func (f *Fixed64) Serialize(w io.Writer) error

func (Fixed64) String

func (f Fixed64) String() string

type Uint168

type Uint168 [UINT168SIZE]uint8

func Uint168FromBytes

func Uint168FromBytes(f []byte) (Uint168, error)

func Uint68FromAddress

func Uint68FromAddress(address string) (Uint168, error)

func (*Uint168) CompareTo

func (u *Uint168) CompareTo(o Uint168) int

func (*Uint168) Deserialize

func (f *Uint168) Deserialize(r io.Reader) error

func (*Uint168) Serialize

func (u *Uint168) Serialize(w io.Writer) (int, error)

func (*Uint168) ToAddress

func (f *Uint168) ToAddress() (string, error)

func (*Uint168) ToArray

func (u *Uint168) ToArray() []byte

func (*Uint168) ToArrayReverse

func (u *Uint168) ToArrayReverse() []byte

type Uint256

type Uint256 [UINT256SIZE]uint8

func Uint256ParseFromBytes

func Uint256ParseFromBytes(f []byte) (Uint256, error)

func (*Uint256) CompareTo

func (u *Uint256) CompareTo(o Uint256) int

func (*Uint256) Deserialize

func (u *Uint256) Deserialize(r io.Reader) error

func (*Uint256) Serialize

func (u *Uint256) Serialize(w io.Writer) (int, error)

func (*Uint256) ToArray

func (u *Uint256) ToArray() []byte

func (*Uint256) ToArrayReverse

func (u *Uint256) ToArrayReverse() []byte

func (*Uint256) ToString added in v0.0.3

func (u *Uint256) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL