Documentation ¶
Index ¶
Constants ¶
View Source
const UInt256ByteLength = 32
UInt256ByteLength is the length of a uint256 in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LittleEndian ¶
type LittleEndian []byte
LittleEndian represents a uint256 number. It is designed to marshal and unmarshal JSON in little-endian format, while under the hood storing the value as big-endian for compatibility with.
func (*LittleEndian) Big ¶
func (s *LittleEndian) Big() *big.Int
Big converts an LittleEndian to a big.Int.
func (LittleEndian) MarshalJSON ¶
func (s LittleEndian) MarshalJSON() ([]byte, error)
MarshalJSON marshals a LittleEndian to JSON, it flips the endianness before encoding it to hex such that it is marshalled as big-endian.
func (*LittleEndian) UInt256 ¶
func (s *LittleEndian) UInt256() *uint256.Int
UInt256 converts an LittleEndian to a uint256.Int.
func (*LittleEndian) UnmarshalJSON ¶
func (s *LittleEndian) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals a LittleEndian from JSON by decoding the hex string and flipping the endianness, such that it is unmarshalled as big-endian.
Click to show internal directories.
Click to hide internal directories.