func (rh *RefHasher) Hash(data []byte) ([]byte, error) {
	d := make([]byte, rh.maxDataLength)
	length := len(data)
	if length > rh.maxDataLength {
		length = rh.maxDataLength
	}
	copy(d, data[:length])
	return rh.hash(d, rh.maxDataLength)
}
Hash returns the BMT hash of the byte slice.
package reference
import (
	"hash"
)
type RefHasher struct {
	maxDataLength int        
	sectionLength int        
	hasher        hash.Hash  
}
func NewRefHasher(h hash.Hash, count int) *RefHasher {
	hashsize := h.Size()
	c := 2
	for ; c < count; c *= 2 {
	}
	return &RefHasher{
		sectionLength: 2 * hashsize,
		maxDataLength: c * hashsize,
		hasher:        h,
	}
}