Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const AddressLength + const HashLength + var Big0 = big.NewInt(0) + var Big1 = big.NewInt(1) + var Big2 = big.NewInt(2) + var Big256 = big.NewInt(256) + var Big257 = big.NewInt(257) + var Big3 = big.NewInt(3) + var Big32 = big.NewInt(32) + var BigInt0 = NewBigInt(0) + var BigInt1 = NewBigInt(1) + var ErrBadFilenameSuffix = errors.New("filename suffix '_temp' is not allowed") + var ErrBadHash = errors.New("hashVal -- loading file with bad hash value") + var ErrBadHeader = errors.New("wrong header") + var ErrBadVersion = errors.New("incompatible file version") + var ErrCorrupted = errors.New(...) + var ErrFileInUse = errors.New("another routine is saving or loading this file") + var ErrFileOpen = errors.New("failed to open the file") + func AbsolutePath(datadir string, filename string) string + func Bytes2Hex(d []byte) string + func BytesToUint64(b []byte) uint64 + func CopyBytes(b []byte) (copiedBytes []byte) + func ErrCompose(errs ...error) error + func ErrContains(src, tar error) bool + func ErrExtend(err, extension error) error + func FileExist(filePath string) bool + func FromHex(s string) []byte + func Hex2Bytes(str string) []byte + func Hex2BytesFixed(str string, flen int) []byte + func IsHexAddress(s string) bool + func LeftPadBytes(slice []byte, l int) []byte + func LoadDxJSON(meta Metadata, filename string, val interface{}) error + func LoadJSON(file string, val interface{}) error + func Lock(locks ...*TryLock) + func MakeName(name, version string) string + func PrintDepricationWarning(str string) + func Report(extra ...interface{}) + func RightPadBytes(slice []byte, l int) []byte + func SaveDxJSON(meta Metadata, filename string, val interface{}) error + func ToHex(b []byte) string + func ToHexArray(b [][]byte) []string + func Uint64ToByte(num uint64) []byte + type Address [AddressLength]byte + func BigToAddress(b *big.Int) Address + func BytesToAddress(b []byte) Address + func HexToAddress(s string) Address + func (a *Address) Scan(src interface{}) error + func (a *Address) SetBytes(b []byte) + func (a *Address) UnmarshalJSON(input []byte) error + func (a *Address) UnmarshalText(input []byte) error + func (a Address) Big() *big.Int + func (a Address) Bytes() []byte + func (a Address) Format(s fmt.State, c rune) + func (a Address) Hash() Hash + func (a Address) Hex() string + func (a Address) MarshalText() ([]byte, error) + func (a Address) String() string + func (a Address) Value() (driver.Value, error) + type BigInt struct + func NewBigInt(x int64) BigInt + func NewBigIntFloat64(x float64) BigInt + func NewBigIntUint64(x uint64) BigInt + func PtrBigInt(x *big.Int) (y BigInt) + func RandomBigInt() BigInt + func RandomBigIntRange(x BigInt) (random BigInt, err error) + func (x *BigInt) DecodeRLP(st *rlp.Stream) error + func (x *BigInt) UnmarshalJSON(val []byte) error + func (x BigInt) Add(y BigInt) (sum BigInt) + func (x BigInt) AddInt64(y int64) (sum BigInt) + func (x BigInt) AddUint64(y uint64) (sum BigInt) + func (x BigInt) BigIntPtr() *big.Int + func (x BigInt) Cmp(y BigInt) (result int) + func (x BigInt) CmpUint64(y uint64) (result int) + func (x BigInt) Div(y BigInt) (quotient BigInt) + func (x BigInt) DivNoRemaining(y uint64) (noRemaining bool) + func (x BigInt) DivUint64(y uint64) (quotient BigInt) + func (x BigInt) DivWithFloatResult(y BigInt) (quotient float64) + func (x BigInt) DivWithFloatResultUint64(y uint64) (quotient float64) + func (x BigInt) EncodeRLP(w io.Writer) error + func (x BigInt) Float64() (result float64) + func (x BigInt) IsEqual(y BigInt) bool + func (x BigInt) IsNeg() bool + func (x BigInt) MarshalJSON() ([]byte, error) + func (x BigInt) Mult(y BigInt) (prod BigInt) + func (x BigInt) MultFloat64(y float64) (prod BigInt) + func (x BigInt) MultInt64(y int64) (prod BigInt) + func (x BigInt) MultUint64(y uint64) (prod BigInt) + func (x BigInt) SetInt64(y int64) BigInt + func (x BigInt) Sign() int + func (x BigInt) String() string + func (x BigInt) Sub(y BigInt) (diff BigInt) + func (x BigInt) SubInt64(y int64) (diff BigInt) + func (x BigInt) SubUint64(y uint64) (diff BigInt) + type ErrorSet struct + ErrSet []error + func (es ErrorSet) Error() string + type Hash [HashLength]byte + func BigToHash(b *big.Int) Hash + func BytesToHash(b []byte) Hash + func HexToHash(s string) Hash + func (h *Hash) Scan(src interface{}) error + func (h *Hash) SetBytes(b []byte) + func (h *Hash) UnmarshalJSON(input []byte) error + func (h *Hash) UnmarshalText(input []byte) error + func (h Hash) Big() *big.Int + func (h Hash) Bytes() []byte + func (h Hash) Format(s fmt.State, c rune) + func (h Hash) Generate(rand *rand.Rand, size int) reflect.Value + func (h Hash) Hex() string + func (h Hash) MarshalText() ([]byte, error) + func (h Hash) String() string + func (h Hash) TerminalString() string + func (h Hash) Value() (driver.Value, error) + type Metadata struct + Header string + Version string + type MixedcaseAddress struct + func NewMixedcaseAddress(addr Address) MixedcaseAddress + func NewMixedcaseAddressFromString(hexaddr string) (*MixedcaseAddress, error) + func (ma *MixedcaseAddress) Address() Address + func (ma *MixedcaseAddress) MarshalJSON() ([]byte, error) + func (ma *MixedcaseAddress) Original() string + func (ma *MixedcaseAddress) String() string + func (ma *MixedcaseAddress) UnmarshalJSON(input []byte) error + func (ma *MixedcaseAddress) ValidChecksum() bool + type PrettyAge time.Time + func (t PrettyAge) String() string + type PrettyDuration time.Duration + func (d PrettyDuration) String() string + type StorageSize float64 + func (s StorageSize) String() string + func (s StorageSize) TerminalString() string + type TryLock struct + func (tl *TryLock) Lock() + func (tl *TryLock) TryLock() bool + func (tl *TryLock) Unlock() + type UnprefixedAddress Address + func (a *UnprefixedAddress) UnmarshalText(input []byte) error + func (a UnprefixedAddress) MarshalText() ([]byte, error) + type UnprefixedHash Hash + func (h *UnprefixedHash) UnmarshalText(input []byte) error + func (h UnprefixedHash) MarshalText() ([]byte, error) + type WPLock struct + func (wp *WPLock) Lock() + func (wp *WPLock) RLock() + func (wp *WPLock) RUnlock() + func (wp *WPLock) Unlock()