utils

package
v0.0.0-...-ebb7192 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = logrus.New()

Logger is new logrus logger instantiate.

Functions

func ArrayOfBytes

func ArrayOfBytes(i int, b byte) (p []byte)

create an array filled with b ArrayOfBytes(3,0) => [0 0 0]

func BigIntJoin

func BigIntJoin(expectedLen int, bigs ...*big.Int) *big.Int

Join bigInt, and padding it when less than `expectedLen`.

func Bytes2BigInt

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

convert bytes array to BigInt

func FitBytesInto

func FitBytesInto(d []byte, i int) []byte

func Map

func Map(f interface{}, vs interface{}) interface{}

Map Example:

numbers := []int{1, 2, 3}
fmt.Println("Square", numbers, f.Map(func(x int) int { return x * x }, numbers))

origin by: https://github.com/izqui/functional

func SplitBig

func SplitBig(b *big.Int, parts int) []*big.Int

Split bigInt into `parts` parts.

func StripByte

func StripByte(d []byte, b byte) []byte

func Timeout

func Timeout(i time.Duration) chan bool

Types

This section is empty.

Directories

Path Synopsis
sm2
sm3

Jump to

Keyboard shortcuts

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