utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigToHex

func BigToHex(bigInt big.Int) string

BigToHex covert big.Int to hexadecimal representation

func Bytes2BigInt

func Bytes2BigInt(bytes []byte) *big.Int

func Bytes2Hex

func Bytes2Hex(bytes []byte) string

func Bytes2HexP

func Bytes2HexP(bytes []byte) string

with prefix '0x'

func Debug

func Debug(format string, v ...interface{})

func DecimalToBigInt

func DecimalToBigInt(d decimal.Decimal) *big.Int

func Error

func Error(format string, v ...interface{})

func Hex2BigInt

func Hex2BigInt(str string) *big.Int

func Hex2Bytes

func Hex2Bytes(str string) []byte

func Hex2Int

func Hex2Int(hex string) uint64

just return uint64 type

func Info

func Info(format string, v ...interface{})

func Int2Bytes

func Int2Bytes(i uint64) []byte

func Int2Hex

func Int2Hex(number uint64) string

func IntToDecimal

func IntToDecimal(value interface{}) decimal.Decimal

func IntToHex

func IntToHex(i int) string

IntToHex convert int to hexadecimal representation

func LeftPadBytes

func LeftPadBytes(slice []byte, l int) []byte

LeftPadBytes zero-pads slice to the left up to length l.

func NumberToString

func NumberToString(number interface{}) string

func ParseInt

func ParseInt(number string, defaultNumber int) int

func RightPadBytes

func RightPadBytes(slice []byte, l int) []byte

RightPadBytes zero-pads slice to the right up to length l.

func StringToDecimal

func StringToDecimal(str string) decimal.Decimal

To Decimal

func ToJsonString

func ToJsonString(o interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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