/XorHashDemo

Primary LanguageC#MIT LicenseMIT

XorHashDemo

A quick and dirty implementation of the algorithm described in this reddit comment

The algorithm works as follows:

  1. Start with a xorsum of 32 nullbytes
  2. Begin enumerating files in a given directory
  3. Open the file and hash <filename>\0<contents> using SHA256
  4. xorsum=xorsum XOR hash
  5. If the directory contains more files, go to step 2
  6. Done. xorsum contains a sort order independent, combined hash of all files.