bigint

package
v0.171.12 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FixedLength = 32 // u256 -> 32 bytes

Variables

This section is empty.

Functions

This section is empty.

Types

type BigInt

type BigInt struct {
	*big.Int
}

func (BigInt) MarshalJSON

func (b BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(p []byte) error

type HexBigInt added in v0.146.3

type HexBigInt struct {
	*big.Int
}

Unmarshals a u256 as a fixed-length hex string with 0x prefix and leading zeros

func (*HexBigInt) UnmarshalJSON added in v0.146.3

func (b *HexBigInt) UnmarshalJSON(input []byte) error

type SQLBigInt

type SQLBigInt big.Int

SQLBigInt type for storing uint256 in the databse. FIXME(dshulyak) SQL big int is max 64 bits. Maybe store as bytes in big endian and hope that lexographical sorting will work.

func (*SQLBigInt) Scan

func (i *SQLBigInt) Scan(value interface{}) error

Scan implements interface.

func (*SQLBigInt) Value

func (i *SQLBigInt) Value() (driver.Value, error)

Value implements interface.

type SQLBigIntBytes

type SQLBigIntBytes big.Int

SQLBigIntBytes type for storing big.Int as BLOB in the databse.

func (*SQLBigIntBytes) Scan

func (i *SQLBigIntBytes) Scan(value interface{}) error

func (*SQLBigIntBytes) Value

func (i *SQLBigIntBytes) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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