How to use the crc/crc32 function in crc

To help you get started, we’ve selected a few crc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexgorbatchev / node-crc / webpack-test / index.js View on Github external
import crc32 from 'crc/crc32';
import crc from 'crc';

// eslint-disable-next-line no-console
console.log(crc32('hello world'), crc.crc32('hello world'));
github mozilla / send / app / zip.js View on Github external
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);
    }
  }
}

crc

Module for calculating Cyclic Redundancy Check (CRC) for Node.js and the browser.

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis