daleharvey/pouchdb — pull request #989 by DrYSG (2013-10-30 17:28:08+00:00)
Title: Changed pouch.idb.js and md5.js for IE binary blobs. Faster MD5 and uses...

What I did to enable binary blobs for IE10 & IE11

[I will not say that my edits are up to my standards of professionalism. Largely since I don't know the conventions and full pouchdb codebase contents. I also
can't say that it is the most efficient solution, or works on all platforms, since I cannot test that. So look at my comments below. But it does work on Chrome and IE11.

Please do look over my work, and see if there are other areas in the codebase that need to be adapted, and if I blew any old browser support]

Edits to IDB adapter
Added attribute BlobSupport to PouchDB (line 133 and following)
changed function preprocessAttachment() to use Uint8Array array instead of normal array, and call the new fast MD5 algorithm.
Note that IE needs to use this new array, since the FileReader cannot use normal arrays on IE.

I also added the function arrayBufferToBase64() for Chrome which it will need until binary blobs are supported in a few months
see: https://code.google.com/p/chromium/issues/detail?id=108012

Edits to deps/MD5.js

Added a new function called FastMD5 which should be faster than the old one. It also uses a Uint8Array,
which should also make it faster.