func (h *Hasher) Reset() {
	h.pos = 0
	h.size = 0
	h.offset = 0
	copy(h.span, zerospan)
}
Reset prepares the Hasher for reuse
package bmt
import (
	"encoding/binary"
	"hash"
	"github.com/ethsana/sana/pkg/swarm"
)
var _ Hash = (*Hasher)(nil)
var (
	zerospan    = make([]byte, 8)
	zerosection = make([]byte, 64)
)
type Hasher struct {
	*Conf               
	bmt    *tree        
	size   int          
	pos    int          
	offset int          
	result chan []byte  
	errc   chan error   
	span   []byte       
}
func (h *Hasher) Capacity() int {
	return h.maxSize
}
func LengthToSpan(length int64) []byte {
	span := make([]byte, SpanSize)
	binary.LittleEndian.PutUint64(span, uint64(length))
	return span
}
func (h *Hasher) SetHeaderInt64(length int64) {
	binary.LittleEndian.PutUint64(h.span, uint64(length))
}
func (h *Hasher) SetHeader(span []byte) {
	copy(h.span, span)
}
func (h *Hasher) Size() int {
	return h.segmentSize
}
func (h *Hasher) BlockSize() int {
	return 2 * h.segmentSize
}
func (h *Hasher) Hash(b []byte) ([]byte, error) {
	if h.size == 0 {
		return sha3hash(h.span, h.zerohashes[h.depth])
	}
	copy(h.bmt.buffer[h.size:], zerosection)
	go h.processSection(h.pos, true)
	select {
	case result := <-h.result:
		return sha3hash(h.span, result)
	case err := <-h.errc:
		return nil, err
	}
}
func (h *Hasher) Sum(b []byte) []byte {
	s, _ := h.Hash(b)
	return s
}
func (h *Hasher) Write(b []byte) (int, error) {
	l := len(b)
	max := h.maxSize - h.size
	if l > max {
		l = max
	}
	copy(h.bmt.buffer[h.size:], b)
	secsize := 2 * h.segmentSize
	from := h.size / secsize
	h.offset = h.size % secsize
	h.size += l
	to := h.size / secsize
	if l == max {
		to--
	}
	h.pos = to
	for i := from; i < to; i++ {
		go h.processSection(i, false)
	}
	return l, nil
}