Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import crc32 from 'crc/crc32';
import crc from 'crc';
// eslint-disable-next-line no-console
console.log(crc32('hello world'), crc.crc32('hello world'));
append(data, controller) {
this.bytesRead += data.byteLength;
const endIndex = data.byteLength - Math.max(this.bytesRead - this.size, 0);
const buf = data.slice(0, endIndex);
this.crc = crc32(buf, this.crc);
controller.enqueue(buf);
if (endIndex < data.byteLength) {
return data.slice(endIndex, data.byteLength);
}
}
}