Documentation ¶
Index ¶
- Constants
- func Bytes2Hex(d []byte) string
- func CopyBytes(b []byte) (copiedBytes []byte)
- func FromHex1(s string) []byte
- func FromHex2Bytes(s string) []byte
- func Hex2Bytes(str string) []byte
- func Int256Min(a, b *uint256.Int) *uint256.Int
- func IsHexAddress(s string) bool
- func KeyCmp(key1, key2 []byte) (int, bool)
- func LeftPadBytes(slice []byte, l int) []byte
- func ReturnHasherToPool(h *Hasher)
- func RightPadBytes(slice []byte, l int) []byte
- func TrimLeftZeroes(s []byte) []byte
- func TrimRightZeroes(s []byte) []byte
- type Address
- func (a Address) Bytes() []byte
- func (a *Address) DecodeBytes(b []byte) bool
- func (a *Address) DecodeString(s string) bool
- func (a Address) Equal(other Address) bool
- func (a Address) Hash() Hash
- func (a Address) Hex() string
- func (a *Address) IsNull() bool
- func (a Address) Marshal() ([]byte, error)
- func (a Address) MarshalText() ([]byte, error)
- func (a *Address) MarshalTo(data []byte) (n int, err error)
- func (a *Address) Scan(src interface{}) error
- func (a *Address) SetBytes(b []byte) *Address
- func (a Address) Size() int
- func (a Address) String() string
- func (a *Address) Unmarshal(data []byte) error
- func (a *Address) UnmarshalJSON(input []byte) error
- func (a *Address) UnmarshalText(input []byte) error
- func (a Address) Value() (driver.Value, error)
- type Addresses
- type Bloom
- type Hash
- func (h Hash) Big() *big.Int
- func (h Hash) Bytes() []byte
- func (h Hash) Equal(other Hash) bool
- 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) HexBytes() []byte
- func (h Hash) Marshal() ([]byte, error)
- func (h Hash) MarshalText() ([]byte, error)
- func (h *Hash) MarshalTo(data []byte) (n int, err error)
- func (h *Hash) Scan(src interface{}) error
- func (h *Hash) SetBytes(b []byte) error
- func (h *Hash) SetString(s string) error
- func (h *Hash) Size() int
- func (h Hash) String() string
- func (h Hash) TerminalString() string
- func (h *Hash) Unmarshal(data []byte) error
- func (h *Hash) UnmarshalJSON(input []byte) error
- func (h *Hash) UnmarshalText(input []byte) error
- func (h Hash) Value() (driver.Value, error)
- type Hasher
- type Hashes
- type PublicKey
- func (h PublicKey) Bytes() []byte
- func (h PublicKey) Format(s fmt.State, c rune)
- func (h PublicKey) Hex() string
- func (h PublicKey) Marshal() ([]byte, error)
- func (a PublicKey) MarshalText() ([]byte, error)
- func (h *PublicKey) SetBytes(b []byte) error
- func (h PublicKey) Size() int
- func (h PublicKey) String() string
- func (h *PublicKey) Unmarshal(data []byte) error
- func (a *PublicKey) UnmarshalJSON(input []byte) error
- func (a *PublicKey) UnmarshalText(input []byte) error
- type Signature
- func (h Signature) Bytes() []byte
- func (h Signature) Format(s fmt.State, c rune)
- func (h Signature) Hex() string
- func (h Signature) Marshal() ([]byte, error)
- func (h Signature) MarshalText() ([]byte, error)
- func (h *Signature) SetBytes(data []byte) error
- func (h Signature) Size() int
- func (h Signature) String() string
- func (h *Signature) Unmarshal(data []byte) error
- func (h *Signature) UnmarshalJSON(input []byte) error
- func (h *Signature) UnmarshalText(input []byte) error
- type StorageSize
Constants ¶
const ( AddressLength = 20 // IncarnationLength length of uint64 for contract incarnations IncarnationLength = 2 // Address32Length is the expected length of the Starknet address (in bytes) Address32Length = 32 )
const (
HashLength = 32
)
const PublicKeyLength = 48
const SignatureLength = 96
Variables ¶
This section is empty.
Functions ¶
func FromHex1 ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func FromHex2Bytes ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func IsHexAddress ¶
IsHexAddress verifies whether a string can represent a valid hex-encoded Ethereum address or not.
func LeftPadBytes ¶
LeftPadBytes zero-pads slice to the left up to length l.
func ReturnHasherToPool ¶
func ReturnHasherToPool(h *Hasher)
func RightPadBytes ¶
RightPadBytes zero-pads slice to the right up to length l.
func TrimLeftZeroes ¶
TrimLeftZeroes returns a subslice of s without leading zeroes
func TrimRightZeroes ¶
TrimRightZeroes returns a subslice of s without trailing zeroes
Types ¶
type Address ¶
type Address [AddressLength]byte
func BytesToAddress ¶
BytesToAddress returns Address with value b. If b is larger than len(h), b will be cropped from the left.
func HexToAddress ¶
HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.
func HexToString ¶
func PrivateToAddress ¶
func PublicToAddress ¶
func (*Address) DecodeBytes ¶
func (*Address) DecodeString ¶
func (Address) MarshalText ¶
MarshalText returns the hex representation of a.
func (*Address) SetBytes ¶
SetBytes sets the address to the value of b. If b is larger than len(a), b will be cropped from the left.
func (*Address) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*Address) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type Addresses ¶
type Addresses []Address
Addresses is a slice of common.Address, implementing sort.Interface
type Bloom ¶
type Bloom struct {
// contains filtered or unexported fields
}
func (*Bloom) UnMarshalBloom ¶
type Hash ¶
type Hash [HashLength]byte
func BigToHash ¶
BigToHash sets byte representation of b to hash. If b is larger than len(h), b will be cropped from the left.
func BytesToHash ¶
func HashDifference ¶
HashDifference returns a new set which is the difference between a and b.
func HexToHash ¶
HexToHash sets byte representation of s to hash. If b is larger than len(h), b will be cropped from the left.
func StringToHash ¶
func (Hash) Format ¶
Format implements fmt.Formatter. Hash supports the %v, %s, %v, %x, %X and %d format verbs.
func (Hash) MarshalText ¶
MarshalText returns the hex representation of h.
func (Hash) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*Hash) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type PublicKey ¶
type PublicKey [PublicKeyLength]byte
func (PublicKey) Format ¶
Format implements fmt.Formatter. supports the %v, %s, %q, %x, %X and %d format verbs.
func (PublicKey) MarshalText ¶
MarshalText returns the hex representation of a.
func (*PublicKey) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*PublicKey) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type Signature ¶
type Signature [SignatureLength]byte
func (Signature) MarshalText ¶
MarshalText returns the hex representation of h.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*Signature) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type StorageSize ¶
type StorageSize float64
StorageSize is a wrapper around a float value that supports user friendly formatting.
func (StorageSize) String ¶
func (s StorageSize) String() string
String implements the stringer interface.
func (StorageSize) TerminalString ¶
func (s StorageSize) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.