I am trying to compare hashes of blend files, but I'm running into a few problems. Every time I open Blender and write the default cube mesh to another file and then hash that file, the hash is different. I run the following code from the python console:
from hashlib import sha1
bpy.data.libraries.write('//Lib.blend', {C.object.data})
sha1(open(bpy.path.abspath('//Lib.blend'), 'rb').read()).hexdigest() // resulting hash, different every time
This also happens when I, for example, switch to and from edit mode without altering the mesh. Every time, another hash.
I've been searching the API and the source code to see whether a timestamp is added to the blend file, but have been unable to find anything. Interestingly, when I execute the above code twice without re-opening or editing any object in the scene, the hashes do remain the same.
What causes the hashes to keep changing, even though the data is the same?