Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToHex(d []byte) string
- func CheckAccountNameContent(name string) bool
- func CheckContractNameContent(name string) bool
- func CheckExContractNameContent(name string) bool
- func Elapsed(t uint64) uint64
- func EmptyHash(h Hash) bool
- func Filter(sources []string, filters []string) []string
- func HexStringToBytes(s string) []byte
- func HexToBytes(str string) ([]byte, error)
- func MaxUint128() *big.Int
- func MaxUint256() *big.Int
- func MeasureStart() uint64
- func MicroElapse(t uint64) uint64
- func MicrosecondsAddToSec(src uint64, des uint64) uint64
- func NanoElapse(t uint64) uint64
- func NanoToMicroSec(src uint64) uint64
- func Now() uint64
- func NowToMicroseconds() uint64
- func NowToSeconds() uint64
- func NowToSlotSec(current time.Time, loopMicroSec uint64) uint64
- func NumberToBytes(num interface{}, bits int) []byte
- func ToMicroseconds(current time.Time) uint64
- func ToMilliseconds(m Microsecond) uint64
- func ToNanoseconds(current time.Time) uint64
- func ToSeconds(m Microsecond) uint64
- type Hash
- type MTNode
- type MerkleHashTree
- type Microsecond
- type NameType
- type Queue
Constants ¶
const ACCOUNT_NAME_REGEXP string = "^[a-z][a-z0-9.-]{2,20}$"
const CONTRACT_NAME_REGEXP string = "^[a-z][a-z0-9]{2,9}$"
ACCOUNT_NAME_REGEXP define account name format
const EX_CONTRACT_NAME_REGEXP string = "^[a-z][a-z0-9]{2,9}@[a-z][a-z0-9.-]{2,20}$"
const (
//HashLength the length of hash bytes
HashLength = 32
)
const ( // MaxNameLength define max account name length MaxNameLength int = 21 )
Variables ¶
var AccountReg *regexp.Regexp = regexp.MustCompile(ACCOUNT_NAME_REGEXP)
var ContractReg *regexp.Regexp = regexp.MustCompile(CONTRACT_NAME_REGEXP)
var ExContractReg *regexp.Regexp = regexp.MustCompile(EX_CONTRACT_NAME_REGEXP)
Functions ¶
func CheckAccountNameContent ¶
func MeasureStart ¶
func MeasureStart() uint64
MeasureStart current monotonic clock time use to measure time
func MicrosecondsAddToSec ¶
MicrosecondsAddToSec add seconds
func NanoToMicroSec ¶
NanoToMicroSec convert nanosecond to microsecond
func NowToMicroseconds ¶
func NowToMicroseconds() uint64
NowToMicroseconds return microseconds of now
func NowToSlotSec ¶
NowToSlotSec convert now seconds to slot second
func NumberToBytes ¶
NumberToBytes number code covert to bytes
func ToMicroseconds ¶
ToMicroseconds current time to micro second
func ToMilliseconds ¶
func ToMilliseconds(m Microsecond) uint64
ToMilliseconds micro second to milli second
func ToNanoseconds ¶
ToNanoseconds return nanoseconds of now
Types ¶
type Hash ¶
type Hash [HashLength]byte
Hash the hash data
func ComputeMerkleRootHash ¶
ComputeMerkleRootHash create a merkle hash tree and return root hash
type MerkleHashTree ¶
type MerkleHashTree struct {
Root *MTNode
}
MerkleHashTree merkle hash tree
func CreateMerkleTree ¶
func CreateMerkleTree(hs []Hash) *MerkleHashTree
CreateMerkleTree create a merkle hash tree
type Microsecond ¶
type Microsecond struct {
Count uint64
}
Microsecond micro second type
func MilliSecToMicro ¶
func MilliSecToMicro(m uint64) Microsecond
MilliSecToMicro milli second to micro second
func SecondsToMicro ¶
func SecondsToMicro(s uint64) Microsecond
SecondsToMicro second to micro second
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package types is definition of common type * file description: transaction * @Author: Gong Zibin * @Date: 2017-12-07 * @Last Modified by: * @Last Modified time:
|
Package types is definition of common type * file description: transaction * @Author: Gong Zibin * @Date: 2017-12-07 * @Last Modified by: * @Last Modified time: |