How to test whether two root files contain the same data

I’m trying to modify a root program, and as part of the process, I’d like to test that the output is the same with a given modification.

The program produces a root file with relevant data, and no random number generators or date specific data is stored as part of the root file so in principle, the data saved to this file shouldn’t change between program executions.

Testing has shown the program to produce files of the same size each time the program is run which is promising, but upon hashing them, I’ve discovered that each file has a different hash even when running the exact same program. Using cint to test a specific branch’s data between the two files shows that at least one branch(the one which is most likely to change) has the same data between the two different files.

The problem is that there seems to be ‘unique’ data inserted into the file each time the file is created. Even with the same version of the program, so hashing the file produces different results. (See fUUID here: for instance).

I’ve tried cutting off this header and then comparing the hashes of the trimmed TFiles, but these hashes differ as well, leading me to believe that something like this uuid is insered for each branch as well.

Given all that, is there a proper ‘root’ way to compare the data inside two root files for equality? That is without writing my own specialized program which knows about all the different branches and what not.