hashdeep icon indicating copy to clipboard operation
hashdeep copied to clipboard

Inconsistent file ordering when generating checksums

Open superbonaci opened this issue 4 years ago • 3 comments

Performed md5deep -r folder/ several consecutive times, my surprise is that each time the file order may differ, even if the contents are exactly the same. For example:

First checksum generation:

md5deep -r folder/ > 1.md5
xxxx  clonezilla.iso
xxxx  debian.iso
xxxx  gparted.iso
xxxx  Mac.iso
xxxx  archlinux.iso
xxxx  memtest86-usb.zip

Second checksum generation:

md5deep -r folder/ > 2.md5
xxxx  clonezilla.iso
xxxx  gparted.iso
xxxx  debian.iso
xxxx  Mac.iso
xxxx  memtest86-usb.zip
xxxx  Microsoft.exe

I can't perform any diff 1.md5 2.md5 because the order differs, have to sort them first. Can this be fixed or the file list is randomly generated then checksum is performed?

superbonaci avatar Apr 03 '20 10:04 superbonaci

Maybe it's because of this: https://github.com/jessek/hashdeep/issues/394

superbonaci avatar Apr 17 '20 00:04 superbonaci

Do this: diff <(sort 1.md5) <(sort 2.md5)

paulhargreaves avatar Jul 15 '20 07:07 paulhargreaves