bigintutils

package
v0.414.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

bigints

This package provides helper functions to handle the [big.Int] datatype. While [big.Int] works with pointers the provided functions focus on storing the values as string since very common for input and output.

But there are still conveninece functions offered operating with *big.Int pointers. The end with the suffix Ints.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIntToDecimalString

func AddIntToDecimalString(decimal string, toAdd int) (result string, err error)

func Equals

func Equals(i1 string, i2 string) (bool, error)

func EqualsInts

func EqualsInts(i1 *big.Int, i2 *big.Int) bool

func GetFromDecimalString

func GetFromDecimalString(decimal string) (bigInt *big.Int, err error)

func GetRandomBigIntByInts

func GetRandomBigIntByInts(min *big.Int, max *big.Int) (random *big.Int, err error)

Int returns a uniform random value in [min, max) so min is included and max not.

func GreatherThanInts

func GreatherThanInts(i1 *big.Int, i2 *big.Int) bool

func IncrementDecimalString

func IncrementDecimalString(decimal string) (incremented string, err error)

func ToDecimalString

func ToDecimalString(bigInt *big.Int) (decimal string, err error)

func ToHexStringColonSeparated

func ToHexStringColonSeparated(input *big.Int) (out string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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