bigutil

package module
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 4 Imported by: 1

README

bigutil

Go Reference test Go Report Card

Installation

go get github.com/m0t0k1ch1-go/bigutil/v2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uint256

type Uint256 struct {
	// contains filtered or unexported fields
}

Uint256 is a wrapper for big.Int that represents uint256.

func BigIntToUint256

func BigIntToUint256(x *big.Int) (Uint256, error)

BigIntToUint256 converts the given big.Int to Uint256.

func HexToUint256 added in v2.2.0

func HexToUint256(s string) (Uint256, error)

HexToUint256 converts the given hex string to Uint256.

func MustBigIntToUint256

func MustBigIntToUint256(x *big.Int) Uint256

MustBigIntToUint256 converts the given big.Int to Uint256. It panics for invalid input.

func MustHexToUint256 added in v2.2.0

func MustHexToUint256(s string) Uint256

MustHexToUint256 converts the given hex string to Uint256. It panics for invalid input.

func Uint64ToUint256 added in v2.3.0

func Uint64ToUint256(i uint64) Uint256

Uint64ToUint256 converts the given uint64 to Uint256.

func (Uint256) BigInt

func (i Uint256) BigInt() *big.Int

BigInt returns the big.Int.

func (Uint256) MarshalText added in v2.4.0

func (i Uint256) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Uint256) Scan

func (i *Uint256) Scan(src any) error

Scan implements the sql.Scanner interface.

func (Uint256) String

func (i Uint256) String() string

String implements the fmt.Stringer interface.

func (*Uint256) UnmarshalJSON

func (i *Uint256) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*Uint256) UnmarshalText added in v2.4.0

func (i *Uint256) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Uint256) Value

func (i Uint256) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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