Node CRC32 Utils
Combines two or more CRC32 checksums into new one.
##How to install:
npm install @balena/node-crc-utils
##How to build:
Install emscripten, clone this repo then
npm run build
##Example:
const crcUtils = require('@balena/node-crc-utils');
// for crc32 checksum use lib: https://github.com/brianloveswords/buffer-crc32/
const crc32 = require('buffer-crc32');
const foo = Buffer.from('foo');
const bar = Buffer.from('bar');
const fooCrc32 = crc32(foo); // <Buffer 8c 73 65 21>
const barCrc32 = crc32(bar); // <Buffer 76 ff 8c aa>
const foobar = Buffer.from('foobar');
const foobarCrc32 = crc32(foobar);
crcUtils.ready.then(() => {
const foobarCrc32Combined = crcUtils.crc32_combine(
fooCrc32.readUInt32BE(0),
barCrc32.readUInt32BE(0),
bar.length
);
// CRC32 are the same but Endianness is prepared for GZIP format
console.log(foobarCrc32); // <Buffer 9e f6 1f 95>
console.log(foobarCrc32Combined); // <Buffer 95 1f f6 9e>
});
关于 @balena/node-crc-utils 的常见问题
@balena/node-crc-utils 是什么?
CRC Utils. Combines two or more CRC32 checksums into new one.
如何安装 @balena/node-crc-utils?
在项目目录运行 npm install @balena/node-crc-utils,或使用 pnpm add / yarn add / bun add。
@balena/node-crc-utils 支持 TypeScript 吗?
该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/balena__node-crc-utils 是否存在。
@balena/node-crc-utils 支持 ESM 还是 CommonJS?
以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。
@balena/node-crc-utils 需要什么版本的 Node.js?
package.json 的 engines 字段要求 Node.js >=16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。
@balena/node-crc-utils 可以商用吗?
@balena/node-crc-utils 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。
@balena/node-crc-utils 的下载量有多少?
根据 npm 官方下载统计,@balena/node-crc-utils 在 2026/10/08 – 2026/11/06 这 30 天内被下载 21,470 次,日均约 716 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。
@balena/node-crc-utils 还在维护吗?
最新版本 3.1.0 发布于 2026/06/03(5 个月前);至今共发布 13 个版本,其中过去 12 个月发布了 2 个;首次发布于 2020/11/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。