Add the hash of the file to the properties

Feature Description

When a file upload has finished, the server should calculate a hash of that file on disk using a common hashing algorithm and add the result as a property of that file presented on the WebUI alongside the other file properties.

The hash should be recalculated if the file is edited as well.

Justification

When downloading or uploading a file to seafile,it is often desirable to verify that the integrity of the file is maintained. A hash of the file is the traditional way to do this using one of several common hashing algorithms such as md5 sha1 or sha256 . Users can then easily verify file integrity themselves.

Some scenarios where a user may want this feature would be:

  • Uploading a very large file and wanting to be sure an unknown seafile bug or an unaccounted for edgecase doesn’t lead to the file being silently corrupted. (See my other topic created where such a thing happens)
  • Downloading a binary that the user intends on running on their machine on an untrusted network.

today sha256sum is the standard

With the metadata feature, this can already be done externally: a script can scan changed files, calculate a hash value such as md5 or sha256, and store it in a file property.

If the goal is to have the hash shown in the Web UI as a standard file property, that would likely need additional UI support. For integrity verification specifically, sha256 is generally the preferred choice today.