icutils

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemePattern   = `(http:\/\/|https:\/\/)`
	HostNamePattern = `(localhost|(?:[\w\d](?:[\w\d-]{0,61}[\w\d])\.)+[\w\d][\w\d-]{0,61}[\w\d])`
	IPv4Pattern     = `(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])`
	PortPattern     = `(:[0-9]{1,5})?`
	PathPattern     = `(\/\S*)?`
	EmailPattern    = `[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*@` + HostNamePattern

	PortMax       = 65536
	EmailLocalMax = 64
	EmailMax      = 254
)

Variables

View Source
var BigIntICX = big.NewInt(1_000_000_000_000_000_000)

Functions

func BigInt2HexInt

func BigInt2HexInt(value *big.Int) *common.HexInt

func CalcPower added in v1.4.0

func CalcPower(br icmodule.Rate, bonded, voted *big.Int) *big.Int

CalcPower calculates the amount of power with bondRequirement, bonded and voted (= bonded + delegated)

func ContainsAll added in v1.4.0

func ContainsAll(flags, flag int) bool

func ContainsAny added in v1.4.0

func ContainsAny(flags, flag int) bool

func ICXToIScore added in v0.9.8

func ICXToIScore(icx *big.Int) *big.Int

func IScoreToICX added in v0.9.8

func IScoreToICX(iScore *big.Int) *big.Int

func IsNil added in v1.1.0

func IsNil(i interface{}) bool

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

func Min

func Min(value1, value2 int) int

func MinBigInt added in v1.4.0

func MinBigInt(v0, v1 *big.Int) *big.Int

func NewIconLogger

func NewIconLogger(logger log.Logger) log.Logger

func Pow10

func Pow10(n int) *big.Int

func ToDecimal

func ToDecimal(x, y int) *big.Int

func ToKey

func ToKey(o interface{}) string

func ToLoop

func ToLoop(icx int) *big.Int

func ValidateCountryAlpha3 added in v0.9.8

func ValidateCountryAlpha3(alpha3 string) error

func ValidateEmail

func ValidateEmail(email string, revision int) error

func ValidateEndpoint

func ValidateEndpoint(endpoint string) error

func ValidateRange

func ValidateRange(oldValue *big.Int, newValue *big.Int, minPct int, maxPct int) error

func ValidateURL

func ValidateURL(url string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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