Documentation ¶
Overview ¶
Package bigint provides common functions for manipulating multi-precision integers.
Index ¶
- func Binary(s string) (*big.Int, bool)
- func BitsSet(x *big.Int) []int
- func BytesLittleEndian(x *big.Int) []byte
- func Clone(x *big.Int) *big.Int
- func Equal(x, y *big.Int) bool
- func EqualInt64(x *big.Int, y int64) bool
- func Extract(x *big.Int, l, h uint) *big.Int
- func Hex(s string) (*big.Int, bool)
- func IsNonZero(x *big.Int) bool
- func IsPow2(x *big.Int) bool
- func IsZero(x *big.Int) bool
- func Mask(l, h uint) *big.Int
- func MinMax(x, y *big.Int) (min, max *big.Int)
- func MustBinary(s string) *big.Int
- func MustHex(s string) *big.Int
- func One() *big.Int
- func Ones(n uint) *big.Int
- func Pow2(e uint) *big.Int
- func Pow2UpTo(x *big.Int) []*big.Int
- func RandBits(r *rand.Rand, n uint) *big.Int
- func Uint64s(x *big.Int) []uint64
- func Zero() *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Binary ¶
Binary parses a binary string into an integer, returning the integer and a boolean indicating success. Underscore may be used as a separator.
func BytesLittleEndian ¶
BytesLittleEndian returns the absolute value of x as a little-endian byte slice.
func EqualInt64 ¶
EqualInt64 is a convenience for checking if x equals the int64 value y.
func Hex ¶
Hex constructs an integer from a hex string, returning the integer and a boolean indicating success. Underscore may be used as a separator.
func MustBinary ¶
MustBinary constructs an integer from a binary string. It panics on error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.