Documentation ¶
Index ¶
- type BigInt
- func (bi *BigInt) GetBytes() []byte
- func (bi *BigInt) GetInt64() int64
- func (bi *BigInt) GetLeftPaddedBytes(length int) ([]byte, error)
- func (bi *BigInt) GetString(base int) string
- func (bi *BigInt) SetBytes(buf []byte)
- func (bi *BigInt) SetInt64(x int64)
- func (bi *BigInt) SetString(x string, base int)
- func (bi *BigInt) Sign() int
- func (bi *BigInt) String() string
- type BigInts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigInt ¶
A BigInt represents a signed multi-precision integer.
func (*BigInt) GetInt64 ¶
GetInt64 returns the int64 representation of x. If x cannot be represented in an int64, the result is undefined.
func (*BigInt) GetLeftPaddedBytes ¶
GetBytes returns the absolute value of x as a big-endian byte slice.
func (*BigInt) GetString ¶
GetString returns the value of x as a formatted string in some number base.
func (*BigInt) SetBytes ¶
SetBytes interprets buf as the bytes of a big-endian unsigned integer and sets the big int to that value.
func (*BigInt) SetString ¶
SetString sets the big int to x.
The string prefix determines the actual conversion base. A prefix of "0x" or "0X" selects base 16; the "0" prefix selects base 8, and a "0b" or "0B" prefix selects base 2. Otherwise the selected base is 10.