hashLeaf = function(treeId, leafIndex, data) {
  e2e.assert(
      treeId.length == TREE_ID_SIZE_BYTES_,
      'tree ID has wrong size (' + treeId.length + ' bytes)',
      InvalidArgumentsError);
  const h = new Sha512_256();
  h.update(LEAF_PREFIX_);
  h.update(treeId);
  h.update(leafIndex.bytes());
  h.update(e2e.dwordArrayToByteArray([TREE_SIZE_]));
  h.update(data);
  return h.digest();
}
Calculates the hash for a leaf node containing this particular data.

@param {!e2e.ByteArray} treeId Eight-byte nonce used to identify this tree.
@param {!TreeIndex} leafIndex Index of the leaf in the tree.
@param {!e2e.ByteArray} data Data associated with the leaf node.
@return {!e2e.ByteArray} Hash output for this leaf node.
@throws {!InvalidArgumentsError} If the treeId is the wrong size.