I am trying to get SHA1 checksum of multiple files.
I tried solution form this thread Generating one MD5/SHA1 checksum of multiple files in Python
So I put together following:
MainScene = "C:/MainScene.xml"
MainScreen = "C:/MainScreen.xml"
Main = "C:/main.brs"
Manifest = "C:/manifest"
flist= [MainScene,MainScreen,Main,Manifest]
hash_obj = hashlib.sha1(open(flist[0], 'rb').read())
for fname in flist[1:]:
hash_obj.update(open(fname, 'rb').read())
checksum = hash_obj.digest()
print checksum
But output would be:
But it gives me wrong results:
'\xdcRjgd\xcb"1\xadZ\x88\xf2\xb6\x18\xd7i)\x19\xc7)'
Which is not correct, I think that issue is with my files list, can someone please tell me what is wrong about it?
.hexdigest()
for instance?.hexdigest()
instead of.digest()
?