Cool concept and a great usage of WebWorkers. I can see this being useful to verify the integrity of files uploaded via an HTML form - get the SHA1 client-side and verify it against a SHA1 server-side.<p>Unfortunately this implementation is way too slow for large files. In Chrome 15 OSX running a Core 2 Duo 2.4GHz an ~650MB file takes about 9.3 minutes to calculate the resultant SHA. Using openssl the hash generation takes ~8 seconds. (Bearing in mind that it's not fair to compare an interpreted script against a compiled program.)
In worker.js :<p>//Firefox doesn't support FileReader inside WebWorkers<p>I noticed that Firefox has FileReaderSync available only from Web Workers. <a href="https://developer.mozilla.org/en/DOM/FileReaderSync" rel="nofollow">https://developer.mozilla.org/en/DOM/FileReaderSync</a><p>Per spec (<a href="http://dev.w3.org/2006/webapi/FileAPI/#readingOnThreads" rel="nofollow">http://dev.w3.org/2006/webapi/FileAPI/#readingOnThreads</a>) web workers can use both. The use cases I have will work fine with the sync interface, but I wonder why Firefox chose not to provide the async option in workers.