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 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 ¶
var ( BlankHash = make([]byte, hashLength) ZeroHash = Keccak256(nil) )
Functions ¶
func EVMIntToHashBytes ¶
EVMIntToHashBytes returns the absolute value of x as a big-endian fixed length byte slice.
func Has0xPrefix ¶
func LeftPadBytes ¶
LeftPadBytes zero-pads slice to the left up to length l.
func LeftPaddingSlice ¶
func RightPaddingSlice ¶
func ZXAddressFromCertificatePEM ¶
ZXAddressFromCertificatePEM computes the address in Zhi Xin Lian format from a certificate PEM
func ZXAddressFromCertificatePath ¶
ZXAddressFromCertificatePath computes the address in Zhi Xin Lian format from a certificate file path
func ZXAddressFromPublicKey ¶
ZXAddressFromPublicKey computes the address of the given public key object in Zhi Xin Lian format
func ZXAddressFromPublicKeyDER ¶
ZXAddressFromPublicKeyDER computes the address in Zhi Xin Lian format from a public key DER
func ZXAddressFromPublicKeyPEM ¶
ZXAddressFromPublicKeyPEM computes the address in Zhi Xin Lian format from a public key PEM
Types ¶
type Address ¶
type Address [AddressLength]byte
func BytesToAddress ¶
BytesToAddress any byte set to a evm address
func HexToAddress ¶
HexToAddress any hex make a evm address
func StringToAddress ¶
StringToAddress any string make a evm address
type Int ¶
func BytesDataToEVMIntHash ¶
BytesDataToEVMIntHash fixed length bytes
func EthHashBytesToEVMInt ¶
EthHashBytesToEVMInt EVMIntToHashBytes reverse
func FromBigInt ¶
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 a evm.Int
func MakeAddressFromString ¶
MakeAddressFromString any str make a evm.Int