"use strict";
/**
 * CRC32 calculation utility for ZIP files (Browser version)
 *
 * Uses lookup table optimization - no Node.js dependencies
 *
 * The polynomial used is the standard CRC-32 IEEE 802.3:
 * x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
 * Represented as 0xEDB88320 in reversed (LSB-first) form
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.crc32Finalize = exports.crc32Update = exports.crc32 = void 0;
exports.ensureCrc32 = ensureCrc32;
var crc32_base_1 = require("./crc32.base.js");
Object.defineProperty(exports, "crc32", { enumerable: true, get: function () { return crc32_base_1.crc32JS; } });
Object.defineProperty(exports, "crc32Update", { enumerable: true, get: function () { return crc32_base_1.crc32UpdateJS; } });
Object.defineProperty(exports, "crc32Finalize", { enumerable: true, get: function () { return crc32_base_1.crc32Finalize; } });
/**
 * Ensure CRC32 is ready (no-op in browser, for API compatibility)
 */
async function ensureCrc32() {
    // No-op in browser
}
/**
 * Calculate CRC32 incrementally (useful for streaming)
 * Call with initial crc of 0xffffffff, then finalize with crc32Finalize
 *
 * @param crc - Current CRC value (start with 0xffffffff)
 * @param data - Input data chunk
 * @returns Updated CRC value (not finalized)
 *
 * @example
 * ```ts
 * let crc = 0xffffffff;
 * crc = crc32Update(crc, chunk1);
 * crc = crc32Update(crc, chunk2);
 * const checksum = crc32Finalize(crc);
 * ```
 */
