utils

package
v0.0.0-...-031fc53 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BigMax256bit = big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), big.NewInt(0))

BigMax256bit represents 2^256

Functions

func Clear0x

func Clear0x(s string) string

Clear0x removes 0x prefix from hex string

func GetCurrent10MinTimestamp

func GetCurrent10MinTimestamp() int64

GetCurrent10MinTimestamp returns current timestamp without other 10 min remainder

func GetSI

func GetSI(number float64) (float64, string)

GetSI calculates the si prefix of the given number, and returns siDiv and siChar

func HexStrToBigInt

func HexStrToBigInt(hexStr string) *big.Int

HexStrToBigInt converts hex string to big.Int

func IsInvalidAddress

func IsInvalidAddress(s string) error

IsInvalidAddress checks if given address is invalid

func MustSoftHexToUint64

func MustSoftHexToUint64(s string) uint64

MustSoftHexToUint64 is a must function that converts Hex to Uint64 without panic

func PadByteArrayStart

func PadByteArrayStart(bytearray []byte, totalBytes int) []byte

PadByteArrayStart pads big endian integer to required amount of bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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