Works with any backend npm install Zero dependencies

File Hashing (CRC32)

Compute CRC32 checksums for uploaded files for integrity verification.

(function() {
 var logEl = document.getElementById('log');
 function log(m) { var d = document.createElement('div'); d.className='pkg-log-entry'; d.textContent=m; logEl.appendChild(d); logEl.scrollTop=logEl.scrollHeight; }
 new MultipleUpload('#demo', {
 uploadUrl: '/api/upload',
 multiple: true,
 computeHash: true,
 hashAlgorithm: 'crc32',
 onHashComputed: function(task, hash) {
 log(task.fileName + ' CRC32: ' + hash);
 }
 });
})();

Hashing before the upload

computeHash defaults to false; turning it on hashes each file in the browser before it is sent, with hashAlgorithm defaulting to 'crc32'. CRC32 is fast and cheap, which is what makes it usable on large files without freezing the page.

What CRC32 is and is not for

It is a checksum: good for spotting accidental corruption in transit and for cheap duplicate detection. It is not a cryptographic hash, and collisions can be constructed deliberately, so it must never be the thing that decides a file is trustworthy. Use SHA-256 where the answer has to hold up against someone trying to break it.

A hash computed in the browser is a claim about a file the server has not seen. Content dedupe on the server has to hash its own copy.