util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt

func BytesToInt(b []byte) int

BytesToInt Bytes are converted to shapes.

func EqualUint64Array

func EqualUint64Array(arr1, arr2 []uint64) bool

func EqualUint64ArraySorted

func EqualUint64ArraySorted(arr1, arr2 []uint64) bool

func HexToBytes

func HexToBytes(input string) []byte

HexToBytes converts a hex string to a byte array. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToDomain

func HexToDomain(input string) spec.Domain

HexToDomain converts a hex string to a spec domain. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToDomainType

func HexToDomainType(input string) spec.DomainType

HexToDomainType converts a hex string to a spec domain type. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToPubKey

func HexToPubKey(input string) spec.BLSPubKey

HexToPubKey converts a hex string to a spec public key. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToRoot

func HexToRoot(input string) spec.Root

HexToRoot converts a hex string to a spec root. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToSignature

func HexToSignature(input string) spec.BLSSignature

HexToSignature converts a hex string to a spec signature. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func HexToVersion

func HexToVersion(input string) spec.Version

HexToVersion converts a hex string to a spec version. This should only be used for pre-defined test strings; it will panic if the input is invalid.

func Int32ToBytes

func Int32ToBytes(n int32) []byte

Int32ToBytes Integers are converted to bytes.

func Int64ToBytes

func Int64ToBytes(n int64) []byte

Int64ToBytes Integers are converted to bytes.

func IntToBytes

func IntToBytes(n int) []byte

IntToBytes Integers are converted to bytes.

func PadByteTo

func PadByteTo(n int) []byte

PadByteTo Make up 0.

func PadByteTo32

func PadByteTo32(n int) []byte

PadByteTo32 Make up 0 to 32 bytes.

func SplitBytes

func SplitBytes(buf []byte, lim int) [][]byte

SplitBytes Splits a byte array into a two-dimensional byte array of a given size.

func TrimLeft0x

func TrimLeft0x(s string) string

TrimLeft0x Remove 0x to the left of the string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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