Documentation ¶
Index ¶
- func Bytes4ToUint32(bytes4 [4]byte) uint32
- func BytesToBytes4(b []byte) (ret [4]byte)
- func CompressSnappy(data []byte) []byte
- func DecodeSSZSnappy(dst ssz.Unmarshaler, src []byte, version int) error
- func DecompressSnappy(data []byte) ([]byte, error)
- func EncodeSSZSnappy(data ssz.Marshaler) ([]byte, error)
- func GetBitlistLength(b []byte) int
- func GetCurrentEpoch(genesisTime uint64, secondsPerSlot uint64, slotsPerEpoch uint64) uint64
- func GetCurrentSlot(genesisTime uint64, secondsPerSlot uint64) uint64
- func GetCurrentSlotOverTime(genesisTime uint64, secondsPerSlot uint64) uint64
- func GetSlotTime(genesisTime uint64, secondsPerSlot uint64, slot uint64) time.Time
- func IntegerSquareRoot(n uint64) uint64
- func IntersectionOfSortedSets(v1, v2 []uint64) []uint64
- func IsPowerOf2(n uint64) bool
- func IsValidMerkleBranch(leaf libcommon.Hash, branch []libcommon.Hash, depth uint64, index uint64, ...) bool
- func Max64(a, b uint64) uint64
- func Min64(a, b uint64) uint64
- func PowerOf2(n uint64) uint64
- func PreparateRootsForHashing(roots []libcommon.Hash) [][32]byte
- func Sha256(data []byte, extras ...[]byte) [32]byte
- func SlotToPeriod(slot uint64) uint64
- func Uint32ToBytes4(n uint32) (ret [4]byte)
- func Uint64ToLE(i uint64) []byte
- type HashFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes4ToUint32 ¶
func BytesToBytes4 ¶
func CompressSnappy ¶
func DecodeSSZSnappy ¶
func DecodeSSZSnappy(dst ssz.Unmarshaler, src []byte, version int) error
func DecompressSnappy ¶
func GetBitlistLength ¶
getBitlistLength return the amount of bits in given bitlist.
func GetCurrentEpoch ¶
compute current epoch.
func GetCurrentSlot ¶
compute current slot.
func GetCurrentSlotOverTime ¶
compute current slot.
func GetSlotTime ¶
compute time of slot.
func IntegerSquareRoot ¶
func IsPowerOf2 ¶
func IsValidMerkleBranch ¶
func IsValidMerkleBranch(leaf libcommon.Hash, branch []libcommon.Hash, depth uint64, index uint64, root [32]byte) bool
Check if leaf at index verifies against the Merkle root and branch
func Uint32ToBytes4 ¶
func Uint64ToLE ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.