Documentation
¶
Index ¶
- Variables
- func CleanPackedAmount(amount *big.Int) (nAmount *big.Int, err error)
- func CleanPackedFee(amount *big.Int) (nAmount *big.Int, err error)
- func HashToInt(b bytes.Buffer, h hash.Hash) (*big.Int, error)
- func ToPackedAmount(amount *big.Int) (res int64, err error)
- func ToPackedFee(amount *big.Int) (res int64, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 2^35 - 1 PackedAmountMaxMantissa = big.NewInt(34359738367) // 2^11 - 1 PackedFeeMaxMantissa = big.NewInt(2047) PackedAmountMaxAmount = ffmath.Multiply(big.NewInt(34359738367), new(big.Int).Exp(big.NewInt(10), big.NewInt(31), nil)) PackedFeeMaxAmount = ffmath.Multiply(big.NewInt(2047), new(big.Int).Exp(big.NewInt(10), big.NewInt(31), nil)) ZeroBigInt = big.NewInt(0) )
Functions ¶
func ToPackedAmount ¶
ToPackedAmount: convert big int to 40 bit, 5 bits for 10^x, 35 bits for a * 10^x
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.