I am looking for a fast, low collision hash implemented in JavaScript. It should not be a crypto hash. I mainly use it as a way to see if a given file has already been downloaded (or partially downloaded) to a user account in order to save some loading time in large (video) files.
I am using the new HTML5 file API to read in file slices. Then I pass this to SparkMD5 to give me a hash of the file. I like the fact that SparkMD5 allows me to do an incremental hash, so I don't need to read everything in memory.
In general, SparkMD5 works for my needs, but it may take some time for large files to get my hash (about 30 seconds for a 300 MB file). Ideally, I would like to reduce this. I am not so versed in hash functions, so I am not looking for something in the port, and I am fine looking for an already implemented library.
source
share