Documentation
¶
Index ¶
- Variables
- func ParseBitlist(dst, buf []byte) ([]byte, uint64)
- type HashFn
- type Hasher
- func (h *Hasher) Append(i []byte)
- func (h *Hasher) AppendBool(b bool)
- func (h *Hasher) AppendBytes32(b []byte)
- func (h *Hasher) AppendUint8(i uint8)
- func (h *Hasher) AppendUint16(i uint16)
- func (h *Hasher) AppendUint32(i uint32)
- func (h *Hasher) AppendUint64(i uint64)
- func (h *Hasher) FillUpTo32()
- func (h *Hasher) Hash() []byte
- func (h *Hasher) HashRoot() (res [32]byte, err error)
- func (h *Hasher) Index() int
- func (h *Hasher) Merkleize(indx int)
- func (h *Hasher) MerkleizeProgressive(indx int)
- func (h *Hasher) MerkleizeProgressiveWithActiveFields(indx int, activeFields []byte)
- func (h *Hasher) MerkleizeProgressiveWithMixin(indx int, num uint64)
- func (h *Hasher) MerkleizeWithMixin(indx int, num, limit uint64)
- func (h *Hasher) PutBitlist(bb []byte, maxSize uint64)
- func (h *Hasher) PutBool(b bool)
- func (h *Hasher) PutBytes(b []byte)
- func (h *Hasher) PutProgressiveBitlist(bb []byte)
- func (h *Hasher) PutRootVector(b [][]byte, maxCapacity ...uint64) error
- func (h *Hasher) PutUint8(i uint8)
- func (h *Hasher) PutUint16(i uint16)
- func (h *Hasher) PutUint32(i uint32)
- func (h *Hasher) PutUint64(i uint64)
- func (h *Hasher) PutUint64Array(b []uint64, maxCapacity ...uint64)
- func (h *Hasher) Reset()
- func (h *Hasher) WithTemp(fn func(tmp []byte) []byte)
- type HasherPool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIncorrectByteSize means that the byte size is incorrect ErrIncorrectByteSize = fmt.Errorf("incorrect byte size") // ErrIncorrectListSize means that the size of the list is incorrect ErrIncorrectListSize = fmt.Errorf("incorrect list size") )
Functions ¶
func ParseBitlist ¶
Types ¶
type HashFn ¶
func NativeHashWrapper ¶
NativeHashWrapper wraps a hash.Hash function into a HashFn
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher is a utility tool to hash SSZ structs
func NewHasherWithHash ¶
NewHasherWithHash creates a new Hasher object with a custom hash.Hash function
func NewHasherWithHashFn ¶
NewHasherWithHashFn creates a new Hasher object with a custom HashFn function
func (*Hasher) AppendBool ¶
func (*Hasher) AppendBytes32 ¶
func (*Hasher) AppendUint8 ¶
func (*Hasher) AppendUint16 ¶
func (*Hasher) AppendUint32 ¶
func (*Hasher) AppendUint64 ¶
func (*Hasher) FillUpTo32 ¶
func (h *Hasher) FillUpTo32()
func (*Hasher) MerkleizeProgressive ¶
Merkleize is used to merkleize the last group of the hasher
func (*Hasher) MerkleizeProgressiveWithActiveFields ¶
MerkleizeProgressiveWithMixin is used to merkleize progressive lists with length mixin
func (*Hasher) MerkleizeProgressiveWithMixin ¶
MerkleizeProgressiveWithMixin is used to merkleize progressive lists with length mixin
func (*Hasher) MerkleizeWithMixin ¶
MerkleizeWithMixin is used to merkleize the last group of the hasher
func (*Hasher) PutBitlist ¶
PutBitlist appends a ssz bitlist
func (*Hasher) PutProgressiveBitlist ¶
func (*Hasher) PutRootVector ¶
PutRootVector appends an array of roots
func (*Hasher) PutUint64Array ¶
PutUint64Array appends an array of uint64
type HasherPool ¶
type HasherPool struct {
HashFn HashFn
// contains filtered or unexported fields
}
HasherPool may be used for pooling Hashers for similarly typed SSZs.
var DefaultHasherPool HasherPool
DefaultHasherPool is a default hasher pool
var FastHasherPool HasherPool = HasherPool{
HashFn: hashtreeHashByteSlice,
}