util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHex

func AddHex(s string, chain ...string) string

func AnalysisMobile

func AnalysisMobile(mobile, region string) string

func AppendIfMissing

func AppendIfMissing(slice []string, i string) []string

func BigIntLog

func BigIntLog(i *big.Int, n *big.Int) *big.Int

func BigToDecimal

func BigToDecimal(v *big.Int) decimal.Decimal

func BlurryMobile

func BlurryMobile(mobile string) string

mobile like +86 151 8888 9998

func BoolToString

func BoolToString(b bool) string

func BytesToHex

func BytesToHex(b []byte) string

func CamelString

func CamelString(s string) string

func DealNegU256

func DealNegU256(s string) *big.Int

func DecodeInputU256

func DecodeInputU256(i *big.Int) string

func EncodeU256

func EncodeU256(s string) *big.Int

func EthToWei

func EthToWei(v decimal.Decimal) *big.Int

func Filter

func Filter(vs []string, f func(int, string) bool) []string

Filter string array

func GetFileType

func GetFileType(uploadFilePath string) string

func HexToBytes

func HexToBytes(s string) []byte

func IntInSlice

func IntInSlice(a int, list []int) bool

func IntToHex

func IntToHex(i interface{}) string

func IntToString

func IntToString(i int) string

func Map

func Map(vs []string, f func(int, string) string) []string

Map string array

func NumberOrString

func NumberOrString(ns interface{}) (interface{}, error)

func Padding

func Padding(str string) string

func PaddingF

func PaddingF(str string) string

func RandStr

func RandStr(length int) string

func ResourceDecode

func ResourceDecode(r string) []int

func SnakeString

func SnakeString(s string) string

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringToInt

func StringToInt(s string) int

func StringToInt64

func StringToInt64(s string) int64

func StringsExclude

func StringsExclude(a []string, b []string) []string

func StringsIntersection

func StringsIntersection(a []string, b []string) []string

func ToWei

func ToWei(v int64) *big.Int

func TrimHex

func TrimHex(s string) string

func TrimTronHex

func TrimTronHex(s string) string

func U256

func U256(v string) *big.Int

Types

type Pair

type Pair struct {
	Key   string
	Value int
}

type PairList

type PairList []Pair

func RankByWordCount

func RankByWordCount(wordFrequencies map[string]int) PairList

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

Jump to

Keyboard shortcuts

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