Documentation ¶
Index ¶
- Constants
- Variables
- func EVMIntToHashBytes(i *Int) [hashLength]byte
- func FromHex(s string) ([]byte, error)
- func GetDataFrom(src []byte, offset uint64, size uint64) []byte
- func Has0xPrefix(str string) bool
- func Keccak256(data []byte) []byte
- func LeftPadBytes(slice []byte, l int) []byte
- func LeftPaddingSlice(src []byte, toSize int) []byte
- func MarshalPublicKey(pk crypto.PublicKey) (pkBytes []byte, err error)
- func MinI(i, j int64) int64
- func RightPaddingSlice(src []byte, toSize int) []byte
- func ZXAddress(data []byte) (string, error)
- func ZXAddressFromCertificatePEM(certPEM []byte) (string, error)
- func ZXAddressFromCertificatePath(certPath string) (string, error)
- func ZXAddressFromPublicKey(pk crypto.PublicKey) (string, error)
- func ZXAddressFromPublicKeyDER(pkDER []byte) (string, error)
- func ZXAddressFromPublicKeyPEM(pkPEM []byte) (string, error)
- type Address
- type Int
- func BytesDataToEVMIntHash(data []byte) *Int
- func EthHashBytesToEVMInt(hash [hashLength]byte) (*Int, error)
- func FromBigInt(i *big.Int) *Int
- func FromDecimalString(s string) *Int
- func FromHexString(s string) *Int
- func FromString(ss string) *Int
- func HashBytesToEVMInt(hash []byte) (*Int, error)
- func MakeAddress(data []byte) *Int
- func MakeAddressFromHex(str string) (*Int, error)
- func MakeAddressFromString(str string) (*Int, error)
- func MinInt(i, j *Int) *Int
- func New(i int64) *Int
- func (i *Int) Add(y *Int) *Int
- func (i *Int) AddMod(y *Int, m *Int) *Int
- func (i *Int) And(y *Int) *Int
- func (i *Int) AsStringKey() string
- func (i *Int) ByteAt(n int) byte
- func (i Int) Clone() *Int
- func (i *Int) Div(y *Int) *Int
- func (i *Int) EQ(y *Int) bool
- func (i *Int) Exp(e *Int) *Int
- func (i *Int) GT(y *Int) bool
- func (i *Int) GetSigned() *Int
- func (i *Int) IsZero() bool
- func (i *Int) LT(y *Int) bool
- func (i *Int) Mod(m *Int) *Int
- func (i *Int) Mul(y *Int) *Int
- func (i *Int) MulMod(y *Int, m *Int) *Int
- func (i *Int) Not(y *Int) *Int
- func (i *Int) Or(y *Int) *Int
- func (i *Int) SAR(n uint64) *Int
- func (i *Int) SDiv(y *Int) *Int
- func (i *Int) SGT(y *Int) bool
- func (i *Int) SHL(n uint64) *Int
- func (i *Int) SHR(n uint64) *Int
- func (i *Int) SLT(y *Int) bool
- func (i *Int) SMod(m *Int) *Int
- func (i *Int) SignExtend(baseBytes *Int) *Int
- func (i *Int) Sub(y *Int) *Int
- func (i *Int) XOr(y *Int) *Int
Constants ¶
const ( ZXAddressLength = 22 ZXAddrPrefixLength = 2 ZXAddrSuffixLength = 20 ZXAddrPrefix = "ZX" )
const (
AddressLength = 20
)
Variables ¶
Functions ¶
func EVMIntToHashBytes ¶
EVMIntToHashBytes returns the absolute value of x as a big-endian fixed length byte slice.
func LeftPadBytes ¶
LeftPadBytes zero-pads slice to the left up to length l.
func MarshalPublicKey ¶ added in v2.3.0
MarshalPublicKey serialize pk to bytes
func ZXAddressFromCertificatePEM ¶ added in v2.1.1
ZXAddressFromCertificatePEM computes the address in Zhi Xin Lian format from a certificate PEM
func ZXAddressFromCertificatePath ¶ added in v2.1.1
ZXAddressFromCertificatePath computes the address in Zhi Xin Lian format from a certificate file path
func ZXAddressFromPublicKey ¶ added in v2.1.1
ZXAddressFromPublicKey computes the address of the given public key object in Zhi Xin Lian format
func ZXAddressFromPublicKeyDER ¶ added in v2.1.1
ZXAddressFromPublicKeyDER computes the address in Zhi Xin Lian format from a public key DER
Types ¶
type Address ¶
type Address [AddressLength]byte
func BytesToAddress ¶
BytesToAddress any byte set to an evm address
func HexToAddress ¶
HexToAddress direct convert hex to an evm address,直接将十六进制字符串转换为Address类型
func MakeHexToAddress ¶ added in v2.3.0
MakeHexToAddress 基于十六进制数据,经过Hash计算获得一个EVM地址 @param s @return Address @return error
func StringToAddress ¶
StringToAddress any string make an evm address
type Int ¶
func BytesDataToEVMIntHash ¶
BytesDataToEVMIntHash fixed length bytes
func EthHashBytesToEVMInt ¶
EthHashBytesToEVMInt EVMIntToHashBytes reverse
func FromDecimalString ¶
FromString from fmt data Int.String()
func FromHexString ¶
FromString from fmt data hex.encodeToString([]byte(Int.AsStringKey))
func HashBytesToEVMInt ¶
HashBytesToEVMInt byte to bigInt
func MakeAddressFromHex ¶
MakeAddressFromHex any hex str make an evm.Int
func MakeAddressFromString ¶
MakeAddressFromString any str make an evm.Int