Search code examples
hashonedrive

Custom hash function


OneDrive 365 propose only QuickXorHash as a hashing algorithm. The goal is to reduce data transfer load; I am investing some time to try to set rules in order to use perceptual hashing function for some media files before upload.

Of course, it would be a second hash, as hashes are used when transferring data as an integrity check.

Is this possible in OneDrive ? I came across rclone but it seems to follow remote rules regarding hashes. If not, probably other solution to custom hash on client that could at least communicate with OneDrive ? Then I probably see how to proceed with a database of hashes of files uploaded in my company group.


Solution

  • Then I probably see how to proceed with a database of hashes of files uploaded in my company group.

    No, I don't seem to agree with this solution. This would come with lot of problems. As one need to maintain hashs in client side.

    Long back I had come across the internal implementation of cloud drives - I believe they maintain metadata as headers (and this header includes hash as well) the header is usually few bytes on the top of file. I believe any additional meta data should go in these headers. I think some of clouds have APIs/CLI for doing this. Probably this is what you are looking for: link