0

Can we generate a file hash, in browser based Javascript, prior to uploading?

We have a web page that allows users to upload files to a server, but notice that some of the files are actually duplicates, per hash.

While we can de-duplicate on the server, by associating uploads with the same hash, we would be interested in going the extra step and not upload the data for a file we already have on our server, based on file hash. This would have the benefit of reducing the amount of data transferred and reduce upload times for duplicate content.

Any suggestions are appreciated.

Andre M
  • 5,724
  • 6
  • 41
  • 80
  • Certainly a duplicate now I search properly, but this answer here seems better than the one linked: https://stackoverflow.com/questions/768268/how-to-calculate-md5-hash-of-a-file-using-javascript . Also this provides thoughts on which algorithm to choose: https://stackoverflow.com/questions/53314863/fastest-algorithm-to-detect-duplicate-files – Andre M Sep 03 '21 at 18:40

0 Answers0