Versions in this module Expand all Collapse all v0 v0.0.2 Sep 20, 2022 Changes in this version + var ErrInvalidPrivateKey = errors.New("err: input private key is not valid! ") + var ErrInvalidPublicKey = errors.New("err: input nil public key is not valid! ") + var ErrInvalidVerifySigPubKey = errors.New("err: input public key is not valid for the signature! ") + func CalHash(msg []byte, hFunc func() hash.Hash) (res []byte, err error) + func DecodePrivateKey(sk string) (privateKey *ecdsa.PrivateKey, err error) + func DecodePrivateKeyBigInt(skStr string) (privateKey *ecdsa.PrivateKey, err error) + func DecodePubKey(pk string) (pubKey *ecdsa.PublicKey, err error) + func EncodePrivateKey(sk *ecdsa.PrivateKey) (priKey string, err error) + func EncodePubKey(pk *ecdsa.PublicKey) (pubKey string, err error) + func EtherToWei(value float64) *big.Int + func IsValidEthAddress(address string) bool + func IsValidHashValue(hash string) bool + func IsValidPrivateKey(sk string) bool + func Sign(sk string, data []byte) (sig []byte, err error) + func VerifySig(pk string, sig []byte, data []byte) (res bool, err error) + func WeiToEther(_balance *big.Int) *big.Float