buffer-crc32 provides a pure JavaScript implementation of the CRC32 algorithm, designed to work seamlessly with binary data and various character encodings by internally casting strings to Buffers. It offers methods to compute the CRC32 checksum and retrieve results as raw Buffer objects, signed integers, or unsigned integers. The library also supports an "append mode," allowing for incremental CRC calculations across multiple data chunks. Currently at version 1.0.0, this package has not seen updates in approximately seven years, suggesting it is stable but effectively abandoned. It requires Node.js version 8.0.0 or higher, potentially posing compatibility challenges for very modern environments that are primarily ESM-based or require newer Node.js features. Its key differentiator is its self-contained, pure JavaScript nature, avoiding native module dependencies.
npm install buffer-crc32Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage with buffers and strings, showing signed/unsigned integer conversion and the append mode for incremental CRC calculations.
Consider testing thoroughly in your target Node.js environment or migrating to a more actively maintained CRC32 library for long-term projects.
Evaluate if an unmaintained library meets your project's security and stability requirements. Consider alternative, actively maintained CRC32 libraries if continuous support is critical.
In ESM, use `import crc32 from 'buffer-crc32';`. If encountering issues, ensure your bundler (Webpack, Rollup, esbuild) or Node.js version handles CommonJS interoperability correctly. For strict TypeScript CommonJS integration, `import crc32 = require('buffer-crc32');` might be an option.Change `import { crc32 } from 'buffer-crc32';` to `import crc32 from 'buffer-crc32';`.Refactor to use ESM import syntax: `import crc32 from 'buffer-crc32';`. If that causes issues with bundlers or runtime, ensure your build configuration supports CommonJS interoperability or use a dynamic import `import('buffer-crc32').then(m => m.default)`. Alternatively, if possible, set `"type": "commonjs"` in your `package.json`.No dependency data recorded yet.