Documentation
¶
Index ¶
- type Uint256
- func (u *Uint256) Add(augend, addend *Uint256) (*Uint256, error)
- func (u *Uint256) Cmp(v *Uint256) int
- func (u *Uint256) Copy(v *Uint256) *Uint256
- func (u *Uint256) DecodeRLP(s *rlp.Stream) error
- func (u *Uint256) EncodeRLP(w io.Writer) error
- func (u *Uint256) Equals(v *Uint256) bool
- func (u Uint256) MarshalJSON() ([]byte, error)
- func (u *Uint256) Mul(multiplicand, multiplier *Uint256) (*Uint256, error)
- func (u *Uint256) Set(value big.Int) (*Uint256, error)
- func (u *Uint256) String() string
- func (u *Uint256) Sub(minuend, subtrahend *Uint256) (*Uint256, error)
- func (u *Uint256) UnmarshalJSON(b []byte) error
- func (u *Uint256) Value() big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uint256 ¶
type Uint256 struct {
// contains filtered or unexported fields
}
Uint256 represents an unsigned integer of 256 bits
func FromUint64 ¶
FromUint64 creates a Uint256 struct based on the given uint64 param any uint64 is valid as a Uint256
func (*Uint256) Add ¶
Add sets u to augend + addend and returns u as the sum returns an error when the result falls outside of the unsigned 256-bit integer range
func (*Uint256) Cmp ¶
Cmp calls the underlying Cmp method for the big.Int stored in a Uint256 struct as its value field
func (*Uint256) Copy ¶
Copy sets the underlying value of u to a copy of the given Uint256 param, and returns the modified receiver struct
func (*Uint256) DecodeRLP ¶
DecodeRLP implements the rlp.Decoder interface it makes sure the `value` field is decoded even though it is private
func (*Uint256) EncodeRLP ¶
EncodeRLP implements the rlp.Encoder interface it makes sure the `value` field is encoded even though it is private
func (*Uint256) Equals ¶
Equals returns true if the two Uint256 structs have the same underlying values, false otherwise
func (Uint256) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface it specifies how to marshal a Uint256 struct so that it can be written to disk
func (*Uint256) Mul ¶
Mul sets u to multiplicand * multiplier and returns u as the product returns an error when the result falls outside of the unsigned 256-bit integer range
func (*Uint256) Set ¶
Set assigns the underlying value of the given Uint256 param to u, and returns the modified receiver struct returns an error when the result falls outside of the unsigned 256-bit integer range
func (*Uint256) Sub ¶
Sub sets u to minuend - subtrahend and returns u as the difference returns an error when the result falls outside of the unsigned 256-bit integer range
func (*Uint256) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface it specifies how to unmarshal a Uint256 struct so that it can be reconstructed from disk