common

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInt added in v0.10.0

func AddInt(a, b int) (int, error)

AddInt makes safe sum for int.

func AddInt64

func AddInt64(a, b int64) (int64, error)

AddInt64 makes safe sum for int64.

func AddUint64

func AddUint64(a, b uint64) (uint64, error)

AddUint64 makes safe sum for uint64.

func Dup

func Dup(b []byte) []byte

Dup duplicate (copy) bytes.

func EnsureTimeout added in v0.8.0

func EnsureTimeout(tm tm, expected uint64)

EnsureTimeout ensures that no way when expected can be higher than current, but if somehow its happened...

func FromBase58JSON

func FromBase58JSON(value []byte, size int, name string) ([]byte, error)

func FromBase58JSONUnchecked added in v0.10.0

func FromBase58JSONUnchecked(value []byte, name string) ([]byte, error)

func FromHexJSON added in v0.10.0

func FromHexJSON(value []byte, size int, name string) ([]byte, error)

func FromHexJSONUnchecked added in v0.10.0

func FromHexJSONUnchecked(value []byte, name string) ([]byte, error)

func GetStatePath

func GetStatePath() (string, error)

func ReplaceInvalidUtf8Chars added in v0.8.0

func ReplaceInvalidUtf8Chars(s string) string

ReplaceInvalidUtf8Chars replaces invalid utf8 characters with '?' to reproduce JVM behaviour.

func SetupLogger

func SetupLogger(level string) (*zap.Logger, *zap.SugaredLogger)

func ToBase58JSON

func ToBase58JSON(b []byte) []byte

func ToBase64JSON added in v0.6.0

func ToBase64JSON(b []byte) []byte

func ToHexJSON added in v0.10.0

func ToHexJSON(b []byte) []byte

func UnixMillisFromTime added in v0.10.0

func UnixMillisFromTime(t time.Time) int64

func UnixMillisToTime added in v0.10.0

func UnixMillisToTime(ts int64) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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