code: func MerkleRoot(hash Trits, siblings Trits, siblingsNumber uint64, leafIndex uint64, spongeFunc ...sponge.SpongeFunction) (Trits, error) {
  	h := sponge.GetSpongeFunc(spongeFunc, curl.NewCurlP27)
  
  	var j uint64 = 1
  	var err error
  
  	for i := uint64(0); i < siblingsNumber; i++ {
  		siblingsIdx := i * HashTrinarySize
  
  		if (leafIndex & j) != 0 {
  			// if index is a right node, absorb a sibling (left) then the hash
  			err = h.Absorb(siblings[siblingsIdx : siblingsIdx+HashTrinarySize])
  			err = h.Absorb(hash)
  		} else {
  			// if index is a left node, absorb the hash then a sibling (right)
  			err = h.Absorb(hash)
  			err = h.Absorb(siblings[siblingsIdx : siblingsIdx+HashTrinarySize])
  		}
  
  		hash, err = h.Squeeze(HashTrinarySize)
  		h.Reset()
  
  		j <<= 1
  	}
  	return hash, err
  }
docs: // MerkleRoot generates a merkle root from a hash and his siblings,
  //	hash is the hash
  //	siblings is the hash siblings
  //	siblingsNumber is the number of siblings
  //	leafIndex is the node index of the hash
  //	spongeFunc is the optional sponge function to use