bigint

package
v0.42.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBaseInvalid = errors.New("invalid base - must be between [2,62]")

Functions

func Copy

func Copy(i *big.Int) *big.Int

Copy returns a copy of a `*big.Int`

func DecodeString added in v0.42.0

func DecodeString(base int, s string) ([]byte, error)

func Div

func Div(a, b *big.Int) *big.Int

Div devides a by b and returns a new `*big.Int`

func EncodeToString added in v0.42.0

func EncodeToString(base int, s []byte) (string, error)

EncodeToString uses [0-9a-zA-Z] for base62.

func HexToInt

func HexToInt(hexNumStr string) *big.Int

HexToInt converts a hex string to a `*big.Int`.

func Int64Mod

func Int64Mod(x, y int64) int64

Int64Mod returns an int64 mod

func IntToBaseXString

func IntToBaseXString(baseX, val int) string

func IntToHex

func IntToHex(n *big.Int) string

IntToHex converts a `*big.Int` to a hex string.

func IsEqual

func IsEqual(a, b *big.Int) bool

IsEqual checks if a == b.

func Mod

func Mod(a, n *big.Int) *big.Int

Mod performs `a mod n`

func MustEncodeToString added in v0.42.0

func MustEncodeToString(base int, s []byte) string

MustEncodeToString uses [0-9a-zA-Z] for base62.

func NewIntString

func NewIntString(val string) *big.Int

NewIntString creates a new `*big.Int` from an uint64.

func NewIntUint64

func NewIntUint64(val uint64) *big.Int

NewIntUint64 creates a new `*big.Int` from an uint64.

func Pow

func Pow(x *big.Int, y *big.Int) *big.Int

Pow is the power function for big ints.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL