Web Worker hashing

SHA-256 & CRC32 off the main thread

Gigabyte hashing runs in an inline Web Worker so the UI stays responsive during the computation. CRC32 uses an 8× faster 256-entry table-driven algorithm; SHA-256 calls crypto.subtle.digest inside the worker. A CSP-safe main-thread fallback kicks in automatically when Workers or Blob URLs are blocked.

Configuration
AjaxUploader.create('#uploader', {
    uploadUrl: '/ajaxupload.axd/upload',
    computeHash: true,
    hashAlgorithm: 'sha256'     // or 'crc32'
});
Use cases
  • Content-addressable storage: use the hash as the storage key so identical uploads de-dupe.
  • Integrity verification: re-hash on the server and compare to catch corruption.
  • Duplicate detection: reject files already in the queue by hash, not by name.
  • Signature workflows: sign the hash rather than the bytes for document signing flows.
Fallback behaviour

When Workers or Blob URLs are unavailable (strict CSP, older browsers), hashing transparently runs on the main thread. The API and the resulting task.hash value are identical; only UI responsiveness during the hash differs.