utils

package
v0.0.0-...-f3b97d8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BoolFromInt = []bool{
		false, true,
	}
)

different representations of boolean type

Functions

func BigIntToByteArray

func BigIntToByteArray(value *big.Int, numBytes int) []byte

BigIntToByteArray converts a BigInteger to a little endian byte array.

func BytesToBigInteger

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

BytesToBigInteger converts a little endian byte array to a BigInteger.

func EqualsBigInts

func EqualsBigInts(first, second *big.Int) bool

EqualsBigInts return true is first & second equals

func GetBit

func GetBit(h []byte, i uint) int

GetBit gets the i'th bit of a byte slice.

func GetBitToBool

func GetBitToBool(h []byte, i uint) bool

GetBitToBool representations as boolean type of the i'th bit

func HexDecodeStringOdd

func HexDecodeStringOdd(s string) ([]byte, error)

HexDecodeStringOdd return padding hex representation of string

func MustHexDecodeString

func MustHexDecodeString(s string) []byte

MustHexDecodeString return hex representation of string

func ReverseByteArray

func ReverseByteArray(a []byte)

ReverseByteArray rearranges the bytes in reverse order

Types

This section is empty.

Jump to

Keyboard shortcuts

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