Documentation ¶
Overview ¶
Package big contains a mostly API-compatible "math/big".Int that JSON-marshals to and from Base64.
Index ¶
- func Jacobi(x, y *Int) int
- type Int
- func (i *Int) Abs(x *Int) *Int
- func (i *Int) Add(x, y *Int) *Int
- func (i *Int) And(x, y *Int) *Int
- func (i *Int) AndNot(x, y *Int) *Int
- func (i *Int) Append(buf []byte, base int) []byte
- func (i *Int) Binomial(n, k int64) *Int
- func (i *Int) Bit(j int) uint
- func (i *Int) BitLen() int
- func (i *Int) Bits() []big.Word
- func (i *Int) Bytes() []byte
- func (i *Int) Cmp(y *Int) int
- func (i *Int) CmpAbs(y *Int) int
- func (i *Int) Div(x, y *Int) *Int
- func (i *Int) DivMod(x, y, m *Int) (*Int, *Int)
- func (i *Int) Exp(x, y, m *Int) *Int
- func (i *Int) Format(s fmt.State, ch rune)
- func (i *Int) GCD(x, y, a, b *Int) *Int
- func (i *Int) Go() *big.Int
- func (i *Int) Int64() int64
- func (i *Int) IsInt64() bool
- func (i *Int) IsUint64() bool
- func (i *Int) Lsh(x *Int, n uint) *Int
- func (i *Int) MarshalBinary() ([]byte, error)
- func (i *Int) MarshalText() ([]byte, error)
- func (i *Int) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (i *Int) Mod(x, y *Int) *Int
- func (i *Int) ModInverse(g, n *Int) *Int
- func (i *Int) ModSqrt(x, p *Int) *Int
- func (i *Int) Mul(x, y *Int) *Int
- func (i *Int) MulRange(a, b int64) *Int
- func (i *Int) Neg(x *Int) *Int
- func (i *Int) Not(x *Int) *Int
- func (i *Int) Or(x, y *Int) *Int
- func (i *Int) ProbablyPrime(n int) bool
- func (i *Int) Quo(x, y *Int) *Int
- func (i *Int) QuoRem(x, y, r *Int) (*Int, *Int)
- func (i *Int) Rand(rnd *rand.Rand, n *Int) *Int
- func (i *Int) Rem(x, y *Int) *Int
- func (i *Int) Rsh(x *Int, n uint) *Int
- func (i *Int) Set(x *Int) *Int
- func (i *Int) SetBit(x *Int, j int, b uint) *Int
- func (i *Int) SetBits(abs []big.Word) *Int
- func (i *Int) SetBytes(buf []byte) *Int
- func (i *Int) SetInt64(x int64) *Int
- func (i *Int) SetString(s string, base int) (*Int, bool)
- func (i *Int) SetUint64(x uint64) *Int
- func (i *Int) Sign() int
- func (i *Int) Sqrt(x *Int) *Int
- func (i *Int) String() string
- func (i *Int) Sub(x, y *Int) *Int
- func (i *Int) Text(base int) string
- func (i *Int) Uint64() uint64
- func (i *Int) UnmarshalBinary(buf []byte) error
- func (i *Int) UnmarshalJSON(b []byte) error
- func (i *Int) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (i *Int) Xor(x, y *Int) *Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Int ¶
Int is an API-compatible "math/big".Int that JSON-marshals to and from Base64. Only supports positive integers.
func RandInt ¶
RandInt wraps "crypto/rand".Int: returns a uniform random value in [0, max). It panics if max <= 0.
func (*Int) MarshalBinary ¶
func (*Int) MarshalText ¶
MarshalText implements encoding.TextMarshaler, returning the base64-encoding of i.Bytes().
func (*Int) MarshalXML ¶
func (*Int) ModInverse ¶
func (*Int) ProbablyPrime ¶
func (*Int) UnmarshalBinary ¶
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. If the input is quoted it attempts a base64 -> []byte -> Int conversion using i.SetBytes(). Otherwise, it attempts to unmarshal the input as a JSON base 10 big integer.
func (*Int) UnmarshalXML ¶
UnmarshalXML implements xml.Unmarshaler, attempting to parse the text of the specified element as a base 10 integer.