hashEmpty = function(treeId, leafIndex, height) {
  e2e.assert(
      treeId.length == TREE_ID_SIZE_BYTES_,
      'tree ID has wrong size (' + treeId.length + ' bytes)',
      InvalidArgumentsError);
  e2e.assert(
      height >= 0 && height <= TREE_SIZE_,
      'height ' + height + ' not in [0, 256]', InvalidArgumentsError);
  const h = new Sha512_256();
  h.update(EMPTY_PREFIX_);
  h.update(treeId);
  h.update(leafIndex.mask(height).bytes());
  const depth = TREE_SIZE_ - height;
  h.update(e2e.dwordArrayToByteArray([depth]));
  return h.digest();
}
Calculates the hash for an empty "node", which represents the collapsing of
an entirely empty subtree up to a particular height.

@param {!e2e.ByteArray} treeId Eight-byte nonce used to identify this tree.
@param {!TreeIndex} leafIndex Index of any leaf contained within the empty
    subtree.
@param {number} height Height of the top of the empty subtree.
@return {!e2e.ByteArray} Hash associated with this empty subtree.
@throws {!InvalidArgumentsError} If the height is not valid.