func BytesToBigInteger(bytes []byte) *big.Int {
	bigEndianBytes := make([]byte, len(bytes)+1)
	for i := range bytes {
		bigEndianBytes[i+1] = bytes[len(bytes)-i-1]
	}
	return (&big.Int{}).SetBytes(bigEndianBytes)
}
BytesToBigInteger converts a little endian byte array to a BigInteger.
package utils
import (
	"encoding/hex"
	"math/big"
)
func ReverseByteArray(a []byte) {
	lenA := len(a)
	j := lenA
	for i := range a[lenA/2:] {
		j--
		a[i], a[j] = a[j], a[i]
	}
}
func MustHexDecodeString(s string) []byte {
	b, err := hex.DecodeString(s)
	if err != nil {
		panic(err)
	}
	return b
}
func HexDecodeStringOdd(s string) ([]byte, error) {
	if len(s)%2 != 0 {
		s = "0" + s
	}
	return hex.DecodeString(s)
}
func BigIntToByteArray(value *big.Int, numBytes int) []byte {
	outputBytes := make([]byte, numBytes)
	bigIntegerBytes := value.Bytes()
	copyStartIndex := 0
	if len(bigIntegerBytes) == 0 {
		return outputBytes
	}
	if 0x00 == bigIntegerBytes[0] {
		copyStartIndex = 1
	}
	numBytesToCopy := len(bigIntegerBytes) - copyStartIndex
	if numBytesToCopy > numBytes {
		copyStartIndex += numBytesToCopy - numBytes
		numBytesToCopy = numBytes
	}
	for i := 0; i < numBytesToCopy; i++ {
		outputBytes[i] = bigIntegerBytes[copyStartIndex+numBytesToCopy-i-1]
	}
	return outputBytes
}