Documentation
¶
Index ¶
- func BytesToInt(b []byte) int
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func CreateProtocolWithChainIdAndFlag(chainId, flag string) string
- func CurrentTimeMillisSeconds() int64
- func CurrentTimeSeconds() int64
- func FibonacciArray(n int) []int64
- func GZipCompressBytes(data []byte) ([]byte, error)
- func GZipDeCompressBytes(data []byte) ([]byte, error)
- func GetChainIdAndFlagWithProtocol(p string) (chainId, flag string)
- func IntToBytes(n int) []byte
- func ParseAddrInfo(addrs []string) ([]peer.AddrInfo, error)
- func ParseMultiAddrs(addrs []string) ([]multiaddr.Multiaddr, error)
- func Uint32ToBytes(n uint32) []byte
- func Uint64ToBytes(n uint64) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProtocolWithChainIdAndFlag ¶
CreateProtocolWithChainIdAndFlag will create a protocol string with a chain id string and a message flag string.
func CurrentTimeMillisSeconds ¶
func CurrentTimeMillisSeconds() int64
CurrentTimeMillisSeconds return current unix timestamp in milliseconds
func CurrentTimeSeconds ¶
func CurrentTimeSeconds() int64
CurrentTimeSeconds return current unix timestamp in seconds
func FibonacciArray ¶
FibonacciArray create a fibonacci array with length n.
func GZipCompressBytes ¶
GZipCompressBytes compress bytes with GZip(BestSpeed mode).
func GZipDeCompressBytes ¶
GZipDeCompressBytes decompress bytes with GZip.
func GetChainIdAndFlagWithProtocol ¶
GetChainIdAndFlagWithProtocol will load the chain id string and the message flag string from a protocol string.
func ParseAddrInfo ¶
ParseAddrInfo parse multi addr string to peer.AddrInfo .
func ParseMultiAddrs ¶
ParseMultiAddrs parse multi addr string to multiaddr.Multiaddr .
Types ¶
This section is empty.